aboutsummaryrefslogtreecommitdiff
path: root/src/tests/prime_sieve/benches/main.rs
diff options
context:
space:
mode:
authorAria Shrimpton <me@aria.rip>2024-01-23 13:43:35 +0000
committerAria Shrimpton <me@aria.rip>2024-01-23 13:43:35 +0000
commitefa6269ca600e57e67f860a1ec420ac80c30acd9 (patch)
tree39ee82db00207bbd933ac70bb51810f95047a530 /src/tests/prime_sieve/benches/main.rs
parent1cfb58a4012e2774f6d2eb507e3e7f361cb4154f (diff)
lints
Diffstat (limited to 'src/tests/prime_sieve/benches/main.rs')
-rw-r--r--src/tests/prime_sieve/benches/main.rs10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/tests/prime_sieve/benches/main.rs b/src/tests/prime_sieve/benches/main.rs
index a055c26..e75a589 100644
--- a/src/tests/prime_sieve/benches/main.rs
+++ b/src/tests/prime_sieve/benches/main.rs
@@ -3,14 +3,16 @@ use criterion::Criterion;
use criterion::{criterion_group, criterion_main};
fn bench_sieve(c: &mut Criterion) {
- let mut group = c.benchmark_group("prime_sieve");
- group.sample_size(20);
for size in [10_000, 20_000, 50_000].iter() {
- group.bench_with_input(BenchmarkId::new("prime_sieve", size), size, |b, &n| {
+ c.bench_with_input(BenchmarkId::new("prime_sieve", size), size, |b, &n| {
b.iter(|| prime_sieve::prime_sieve(n));
});
}
}
-criterion_group!(benches, bench_sieve);
+criterion_group!(
+ name = benches;
+ config = Criterion::default().sample_size(20);
+ targets = bench_sieve
+);
criterion_main!(benches);