Skip to content

Commit

Permalink
ensure we allocate before timing starts in quicksort bench
Browse files Browse the repository at this point in the history
  • Loading branch information
TheIronBorn authored Feb 13, 2024
1 parent 0b8aa98 commit 03317c8
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion rayon-demo/src/quicksort/bench.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ const BENCH_SIZE: usize = 250_000_000 / 512;

fn bench_harness<F: FnMut(&mut [u32])>(mut f: F, b: &mut test::Bencher) {
let base_vec = super::default_vec(BENCH_SIZE);
let mut sort_vec = vec![];
let mut sort_vec = base_vec.clone();
b.iter(|| {
sort_vec.clone_from(&base_vec);
f(&mut sort_vec);
Expand Down

0 comments on commit 03317c8

Please sign in to comment.