diff options
author | Aria Shrimpton <me@aria.rip> | 2024-02-29 16:10:26 +0000 |
---|---|---|
committer | Aria Shrimpton <me@aria.rip> | 2024-02-29 16:10:26 +0000 |
commit | 1b476265f3f6043529d252db5353c27ebd0507b3 (patch) | |
tree | e6b96d2b6d29f44a52e8aa3b7d78a7a891ea9f5f /src/tests/aoc-2022-08/benches/main.rs | |
parent | bb5ec77c534f77ae27856a36e8fa459a1b19356e (diff) |
rename benchmark stuff to be more consistent
Diffstat (limited to 'src/tests/aoc-2022-08/benches/main.rs')
-rw-r--r-- | src/tests/aoc-2022-08/benches/main.rs | 31 |
1 files changed, 0 insertions, 31 deletions
diff --git a/src/tests/aoc-2022-08/benches/main.rs b/src/tests/aoc-2022-08/benches/main.rs deleted file mode 100644 index 1949113..0000000 --- a/src/tests/aoc-2022-08/benches/main.rs +++ /dev/null @@ -1,31 +0,0 @@ -use aoc_2022_08::HeightMap; -use criterion::{criterion_group, criterion_main, BatchSize, BenchmarkId, Criterion}; -use rand::{rngs::StdRng, SeedableRng}; - -fn run_benches(c: &mut Criterion) { - let mut rng = StdRng::seed_from_u64(42); - for size in [1000, 2000].iter() { - c.bench_with_input(BenchmarkId::new("aoc-202208-part1", size), size, |b, &n| { - b.iter_batched_ref( - || HeightMap::gen(&mut rng, n), - |map| map.part1(), - BatchSize::SmallInput, - ) - }); - - c.bench_with_input(BenchmarkId::new("aoc-202208-part2", size), size, |b, &n| { - b.iter_batched_ref( - || HeightMap::gen(&mut rng, n), - |map| map.part2(), - BatchSize::SmallInput, - ) - }); - } -} - -criterion_group!( - name = benches; - config = Criterion::default().sample_size(10); - targets = run_benches -); -criterion_main!(benches); |