aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAria Shrimpton <me@aria.rip>2024-03-10 18:37:59 +0000
committerAria Shrimpton <me@aria.rip>2024-03-10 18:37:59 +0000
commit6a08fd153587608d66a088bd5deee9eeee40c5c0 (patch)
tree37a3e79fc81eab557d9ac887f3ea4100fea925a6
parentb6fe87f7666a445bf7f55965b306e5a9d48bf42d (diff)
benchmark improvements
-rw-r--r--src/tests/example_sets/benches/main.rs2
-rw-r--r--src/tests/example_sets/src/lib.rs4
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())));
}
}