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
AsyncBencher::iter and friends with the tokio runtime uses Runtime::block_on to "do work" which will cause significant slowdown in multi-threaded runtime
#819
We can notice a significant change in benchmark performance when running these two identical benchmarks where only the runtime differs.
Running benches/rt.rs (target/release/deps/rt-b193580270194018)
current thread time: [186.69 ns 187.38 ns 188.26 ns]
Found 4 outliers among 100 measurements (4.00%)
4 (4.00%) high severe
multi thread time: [34.798 µs 35.261 µs 35.804 µs]
Found 8 outliers among 100 measurements (8.00%)
2 (2.00%) low mild
2 (2.00%) high mild
4 (4.00%) high severe
Note that the future required by this function does not run as a worker. The expectation is that other tasks are spawned by the future here. Awaiting on other futures from the future provided here will not perform as fast as those spawned as workers.
However, I do not know if this caveat is apparent to users of the criterion crate.
The text was updated successfully, but these errors were encountered:
Consider the following benchmark code:
We can notice a significant change in benchmark performance when running these two identical benchmarks where only the runtime differs.
This caveat is noted in tokio's documentation
However, I do not know if this caveat is apparent to users of the criterion crate.
The text was updated successfully, but these errors were encountered: