fixedbitset
fixedbitset copied to clipboard
Move tests to a cfg(test) module
Moves all tests to their own module that is hidden behind a #[cfg(test)]
, should speed up compilation time.
How are you measuring build time?
I don't see a difference:
➜ fixedbitset git:(master) hyperfine -- "cargo clean && cargo build --lib --release"
Benchmark 1: cargo clean && cargo build --lib --release
Time (mean ± σ): 589.9 ms ± 48.1 ms [User: 585.7 ms, System: 85.2 ms]
Range (min … max): 516.3 ms … 648.9 ms 10 runs
➜ fixedbitset git:(master) hyperfine -- "cargo clean && cargo build --lib"
Benchmark 1: cargo clean && cargo build --lib
Time (mean ± σ): 617.7 ms ± 40.6 ms [User: 540.6 ms, System: 120.5 ms]
Range (min … max): 568.1 ms … 660.0 ms 10 runs
➜ gco james7132/cfg-test
➜ fixedbitset git:(79253bf) hyperfine -- "cargo clean && cargo build --lib"
Benchmark 1: cargo clean && cargo build --lib
Time (mean ± σ): 619.1 ms ± 46.7 ms [User: 536.7 ms, System: 119.6 ms]
Range (min … max): 523.7 ms … 681.8 ms 10 runs
➜ fixedbitset git:(79253bf) hyperfine -- "cargo clean && cargo build --lib --release"
Benchmark 1: cargo clean && cargo build --lib --release
Time (mean ± σ): 602.4 ms ± 43.0 ms [User: 594.2 ms, System: 86.3 ms]
Range (min … max): 536.3 ms … 658.0 ms 10 runs
Those tests seem to include the IO bottleneck of running cargo clean
. Using https://doc.rust-lang.org/cargo/reference/timings.html might show some closer differences.
Oh --timings
is new. That's quite helpful.