Skip to content
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

testing: lost ns/op precision for fast benchmarks [regression] #30997

Closed
josharian opened this issue Mar 22, 2019 · 1 comment

Comments

Projects
None yet
2 participants
@josharian
Copy link
Contributor

commented Mar 22, 2019

CL 166717 caused a regression in benchmark ns/op printing precision.

We now get benchmark output like:

BenchmarkFast-8     	380491575	         3.00 ns/op

Previously, we got:

BenchmarkFast-8     	380491575	         3.12 ns/op

This is due to a change in BenchmarkResult.String. Previously, when ns/op was small, it recalculated it to get extra precision and had special print handling. Now it always uses the results of BenchmarkResult.NsPerOp, which returns an int64.

cc @aclements

@gopherbot

This comment has been minimized.

Copy link

commented Mar 22, 2019

Change https://golang.org/cl/168937 mentions this issue: testing: fix fractional ns/op printing

@gopherbot gopherbot closed this in 1257d05 Mar 22, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.