bheisler / criterion.rs

Statistics-driven benchmarking library for Rust
Apache License 2.0
4.31k stars 292 forks source link

Update comparing_functions.md #706

Closed Indra-db closed 11 months ago

Indra-db commented 11 months ago

wrap the for loop index in a black_box to prevent optimizations to happen, which lead to incorrect benchmark comparison.

On my machine without the blackbox the slow function took 200 picoseconds while the fast took 2.5ns.