-
Notifications
You must be signed in to change notification settings - Fork 17.9k
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
proposal: benchmarks or benchstat: should question timings less than 1ns #59926
Comments
CC @aclements |
I had an issue somewhere, which I can't find right now, to report when a benchmark seems to be ignoring b.N. Diagnosing that in package testing seems like it makes more sense than doing it in benchstat. |
Perhaps #38677 ? |
CL 230978 is what I was thinking of. I think it would catch anything that would produce 0.03995ns. |
This proposal has been added to the active column of the proposals project |
Austin pointed out various problems with my CL so I wrote a vet check instead. This is now probably a duplicate of #38677. |
One case I don’t think would be covered is when the compiler optimizes away your entire loop. |
This proposal is a duplicate of a previously discussed proposal, as noted above, |
From time to time I see someone quote a benchmark output with a timing like "0.03995ns".
Invariably this means the benchmark is doing nothing at all, e.g. because they forgot to use
b.N
.Similarly to when benchstat advises to use more iterations to get a stable result, it could advise that such a short timing may be an error.
The text was updated successfully, but these errors were encountered: