diff options
Diffstat (limited to 'src/tests/prime_sieve/benches/main.rs')
-rw-r--r-- | src/tests/prime_sieve/benches/main.rs | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/src/tests/prime_sieve/benches/main.rs b/src/tests/prime_sieve/benches/main.rs index fd04578..a055c26 100644 --- a/src/tests/prime_sieve/benches/main.rs +++ b/src/tests/prime_sieve/benches/main.rs @@ -3,10 +3,13 @@ use criterion::Criterion; use criterion::{criterion_group, criterion_main}; fn bench_sieve(c: &mut Criterion) { - let size: usize = 10; - c.bench_with_input(BenchmarkId::new("prime_sieve", size), &size, |b, &n| { - b.iter(|| prime_sieve::prime_sieve(n)); - }); + 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| { + b.iter(|| prime_sieve::prime_sieve(n)); + }); + } } criterion_group!(benches, bench_sieve); |