diff options
author | Aria Shrimpton <me@aria.rip> | 2024-03-10 18:37:59 +0000 |
---|---|---|
committer | Aria Shrimpton <me@aria.rip> | 2024-03-10 18:37:59 +0000 |
commit | 6a08fd153587608d66a088bd5deee9eeee40c5c0 (patch) | |
tree | 37a3e79fc81eab557d9ac887f3ea4100fea925a6 /src/tests/example_sets | |
parent | b6fe87f7666a445bf7f55965b306e5a9d48bf42d (diff) |
benchmark improvements
Diffstat (limited to 'src/tests/example_sets')
-rw-r--r-- | src/tests/example_sets/benches/main.rs | 2 | ||||
-rw-r--r-- | src/tests/example_sets/src/lib.rs | 4 |
2 files changed, 3 insertions, 3 deletions
diff --git a/src/tests/example_sets/benches/main.rs b/src/tests/example_sets/benches/main.rs index 7b46c8e..26e8547 100644 --- a/src/tests/example_sets/benches/main.rs +++ b/src/tests/example_sets/benches/main.rs @@ -1,7 +1,7 @@ use criterion::{criterion_group, criterion_main, BenchmarkId, Criterion}; fn run_benches(c: &mut Criterion) { - for size in [500, 10_000, 50_000].iter() { + for size in [500, 2_000, 10_000, 50_000].iter() { c.bench_with_input( BenchmarkId::new("example_sets-insert_n", size), size, diff --git a/src/tests/example_sets/src/lib.rs b/src/tests/example_sets/src/lib.rs index dff5a27..c5bd163 100644 --- a/src/tests/example_sets/src/lib.rs +++ b/src/tests/example_sets/src/lib.rs @@ -14,7 +14,7 @@ pub fn insert_n(n: usize) { set.insert(random()); } - for i in 0..2 * n { - black_box(|x| x)(black_box(set.contains(&i))); + for _ in 0..2 * n { + black_box(|x| x)(black_box(set.contains(&random()))); } } |