-
Notifications
You must be signed in to change notification settings - Fork 18k
go/benchmark only takes timer measurement as parameter to increase b.N #40226
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Use b.StopTimer/b.StartTimer. Unlike many projects, the Go project does not use GitHub Issues for general discussion or asking questions. GitHub Issues are used for tracking bugs and proposals only. For asking questions, see:
|
It produces the same issue. When it predicates the next Line 125 in c5d7f2f
Line 135 in c5d7f2f
Lines 296 to 324 in c5d7f2f
|
Thank you for raising this issue. This doesn't appear to be a bug in Go. We only use the issue tracker for tracking bugs and proposals. Please see the resources I mentioned above for appropriate places to ask questions. Thank you. |
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
I don't know. AFAIK, this is not a bug, so in theory, YES.
What operating system and processor architecture are you using (
go env
)?go env
OutputWhat did you do?
I'm trying to benchmark a buffer library. I shall test
write
andread
separately. But I need towrite
data to the buffer beforeread
.What did you expect to see?
Hence in this scenario,
read
is much faster thatwrite
. It should ran similar amount of samples.What did you see instead?
But, because
b.ResetTimer
undid all measurements. Whengo/benchmark
trying to workoutb.N
values, It only measured the amount of time toread
, It ended up timed out because of the enormous amount of data towrite
. Say 1,000,000 samples when testwrite
alone, and5,000,000
samples when testread
The text was updated successfully, but these errors were encountered: