diff options
author | Aria Shrimpton <me@aria.rip> | 2024-03-19 22:38:59 +0000 |
---|---|---|
committer | Aria Shrimpton <me@aria.rip> | 2024-03-19 22:38:59 +0000 |
commit | 18be480e89e773f827da930d98618db4a9c9d9f9 (patch) | |
tree | 1ec5ed902a9e40b136c0e8f3d59d241816e719c5 /src/tests/example_sets/benches/main.rs | |
parent | 05715322ad643b39234e0d2f752acc762e760b35 (diff) |
benchmark updates
Diffstat (limited to 'src/tests/example_sets/benches/main.rs')
-rw-r--r-- | src/tests/example_sets/benches/main.rs | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/tests/example_sets/benches/main.rs b/src/tests/example_sets/benches/main.rs index 26e8547..03ab904 100644 --- a/src/tests/example_sets/benches/main.rs +++ b/src/tests/example_sets/benches/main.rs @@ -1,12 +1,14 @@ use criterion::{criterion_group, criterion_main, BenchmarkId, Criterion}; +use rand::{rngs::StdRng, SeedableRng}; fn run_benches(c: &mut Criterion) { - for size in [500, 2_000, 10_000, 50_000].iter() { + let mut rng = StdRng::seed_from_u64(42); + for size in [50, 150, 2_500, 7_500].iter() { c.bench_with_input( BenchmarkId::new("example_sets-insert_n", size), size, |b, &n| { - b.iter(|| example_sets::insert_n(n)); + b.iter(|| example_sets::insert_n(&mut rng, n)); }, ); } |