aboutsummaryrefslogtreecommitdiff
path: root/src/tests/aoc-2022-09/benches/main.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/tests/aoc-2022-09/benches/main.rs')
-rw-r--r--src/tests/aoc-2022-09/benches/main.rs31
1 files changed, 0 insertions, 31 deletions
diff --git a/src/tests/aoc-2022-09/benches/main.rs b/src/tests/aoc-2022-09/benches/main.rs
deleted file mode 100644
index 6eb13e4..0000000
--- a/src/tests/aoc-2022-09/benches/main.rs
+++ /dev/null
@@ -1,31 +0,0 @@
-use aoc_2022_09::{gen_moves, part1, part2};
-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 [100, 1000, 2000].iter() {
- c.bench_with_input(BenchmarkId::new("aoc-202209-part1", size), size, |b, &n| {
- b.iter_batched_ref(
- || gen_moves(&mut rng, n).collect::<Vec<_>>(),
- |moves| part1(moves.iter()),
- BatchSize::SmallInput,
- )
- });
-
- c.bench_with_input(BenchmarkId::new("aoc-202209-part2", size), size, |b, &n| {
- b.iter_batched_ref(
- || gen_moves(&mut rng, n).collect::<Vec<_>>(),
- |moves| part2(moves.iter()),
- BatchSize::SmallInput,
- )
- });
- }
-}
-
-criterion_group!(
- name = benches;
- config = Criterion::default().sample_size(10);
- targets = run_benches
-);
-criterion_main!(benches);