fspoettel / advent-of-code-rust

🎄Starter template for solving Advent of Code in Rust.
MIT License
713 stars 54 forks source link

feat: use black_box for benchmark evaluation #47

Closed fspoettel closed 12 months ago

fspoettel commented 12 months ago

This prevents cases where subsequent invocations of the solution fully unroll it, leading to deceivingly low execution times being reported.

Adopted from https://github.com/bheisler/criterion.rs/blob/b913e232edd98780961ecfbae836ec77ede49259/src/lib.rs#L151-L158