-
Notifications
You must be signed in to change notification settings - Fork 310
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
The suggested measurement time is somewhat too long #351
Comments
Hey, thanks for trying Criterion.rs! I'm not sure what the issue is here? Your benchmark takes too long (approximately 1s per iteration), which makes it impossible to perform the minimum of 5050 iterations in the default 10 seconds. Criterion.rs is recommending that you reduce the sample count from the default of 100 to the minimum of 10 (which would result in 55 iterations for a benchmark time of approximately 60s). Criterion.rs currently doesn't handle long-running benchmarks very well - see #320. |
How does |
The estimate is calculated from the warmup period. Criterion.rs looks at the number of iterations that were completed during the warmup and uses that to estimate how long each iteration took. From there, it's a simple multiplication to estimate how long the benchmark will take. |
In tikv/raft-rs#315, I try to bench a channel-based cluster with Criterion.rs. It seems every iter cost almost 20ms+ (with the smallest throughput). But the benching process hangs after running a while ( about 10minutes) and the CPU is up to 400% in my Macbook. Do you have any suggestions for this scenario? @bheisler |
Hey, thanks for your patience. I've taken a look at your benchmark and I think I can answer your question now. This comes down to a minor aspect of how Criterion.rs does the warmup phase. In the warm-up phase, the time to execute the outer closure is included in the timing, where it is not included in the actual measurements. Your outer closure includes a call to I will adjust this in the next version to make it measure time correctly during the warm-up period. In the meantime, I would recommend a few changes to your benchmarks:
Note for self:
|
I tried to benching a system that has several threads communicating by channels. And after I started
iter_batched
, theCriterion
givens me some info:The text was updated successfully, but these errors were encountered: