cmpute / dashu

A library set of arbitrary precision numbers implemented in Rust.
Apache License 2.0
76 stars 9 forks source link

Bump dev-dependency of criterion to 0.4 #4

Closed lemmih closed 2 years ago

lemmih commented 2 years ago

The new version of criterion has a bunch of convenient features. Prime examples are the --quick and --quiet flags:

$ time cargo bench --bench=benchmarks -- --quick --quiet to_hex
    Finished bench [optimized] target(s) in 0.03s
     Running benches/benchmarks.rs (/home/lemmih/coding/dashu/target/release/deps/benchmarks-bb085885476f3050)
to_hex/10               time:   [46.901 ns 47.163 ns 48.209 ns]
to_hex/100              time:   [88.315 ns 88.406 ns 88.767 ns]
to_hex/1000             time:   [1.1917 µs 1.1938 µs 1.2021 µs]
to_hex/10000            time:   [11.067 µs 11.075 µs 11.109 µs]
to_hex/100000           time:   [110.34 µs 110.88 µs 113.02 µs]
to_hex/1000000          time:   [1.1363 ms 1.1365 ms 1.1366 ms]

real    0m2.925s
user    0m45.749s
sys 0m1.102s

Without the --quick flag, those benchmarks would take 60s to finish rather than 2.9s. And without the --quiet flag, the results would be harder to read.

cmpute commented 2 years ago

Thanks!