You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Printed 'actual iteterations' should not be less-than the iterations reported by the return-value of testing.Benchmark.
What did you see instead?
The number of iterations recorded by my counter was '6'. The number of iterations reported by testing.Benchmark was '1000000000'.
Playground output:
2009/11/10 23:00:00 Result Duration: 3µs
2009/11/10 23:00:00 Result Iterations: 1000000000
2009/11/10 23:00:00 Actual Iterations: 6 (no more than)
2009/11/10 23:00:00 Summary: 1000000000 0.000003 ns/op
This makes the 'ns/op' calculation incorrect.
The text was updated successfully, but these errors were encountered:
Your benchmark does not iterate over b.N. I will not report correct values as the benchmark will appear to run faster the larger the value of b.N supplied.
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
This issue reproduces on the Go playground (as of 2020-07-02).
What operating system and processor architecture are you using (
go env
)?go env
OutputWhat did you do?
https://play.golang.org/p/CYHoKOYMgTj
What did you expect to see?
Printed 'actual iteterations' should not be less-than the iterations reported by the return-value of
testing.Benchmark
.What did you see instead?
The number of iterations recorded by my counter was '6'. The number of iterations reported by
testing.Benchmark
was '1000000000'.Playground output:
This makes the 'ns/op' calculation incorrect.
The text was updated successfully, but these errors were encountered: