-
Notifications
You must be signed in to change notification settings - Fork 5.4k
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
Confusing warning for benchmark start() and end() calls under 0.01s #20853
Comments
Well the issue with this is that the benchmark ends so fast that most of the benchmark is spent in not doing your operation. It's essentially just noise. This is a warning to say "hey, this data is going to be super inaccurate, make your test longer!". I think it could be better worded. |
|
Actually we should measure the total time (not between start/end) when deciding if the test is too short or not. |
It's also a bit confusing as benchmarks which don't use |
This came up when I was trying to benchmark the 1000th insert into a data structure. Something like this:
I don't want to remove
bench.start()
andbench.end()
because then I'll be measuring the duration of the 999 other inserts. So this warning doesn't really help me (nor does it help me understand why this 0.01s limitation is in place when it doesn't seem to apply elsewhere).Related to #20272.
The text was updated successfully, but these errors were encountered: