aboutsummaryrefslogtreecommitdiff
path: root/src/tests/aoc-2022-05/benches/main.rs
diff options
context:
space:
mode:
authorAria Shrimpton <me@aria.rip>2024-02-23 12:37:19 +0000
committerAria Shrimpton <me@aria.rip>2024-02-23 12:42:09 +0000
commit6ebf6ec0f3b243515295a2f5546cfd79fd49903c (patch)
tree5c6a2ce446019e53195a260c66c5ab81cfb9bb7a /src/tests/aoc-2022-05/benches/main.rs
parentb47b4234342c40fca8b45f1387257db6f34522ba (diff)
remove aoc 2022 05
not a suitable test case because it requires mutating through an index, and thats not really the type of thing we're looking to do
Diffstat (limited to 'src/tests/aoc-2022-05/benches/main.rs')
-rw-r--r--src/tests/aoc-2022-05/benches/main.rs39
1 files changed, 0 insertions, 39 deletions
diff --git a/src/tests/aoc-2022-05/benches/main.rs b/src/tests/aoc-2022-05/benches/main.rs
deleted file mode 100644
index 1550359..0000000
--- a/src/tests/aoc-2022-05/benches/main.rs
+++ /dev/null
@@ -1,39 +0,0 @@
-use aoc_2022_05::{gen_random_moves, gen_random_tops, perform_move_9000, perform_move_9001};
-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, 400, 800, 1200, 1600, 2000].iter() {
- c.bench_with_input(BenchmarkId::new("part1", size), size, |b, &n| {
- b.iter_batched_ref(
- || (gen_random_tops(&mut rng, n), gen_random_moves(&mut rng, n)),
- |(tops, moves)| {
- for mv in moves {
- perform_move_9000(tops, *mv);
- }
- },
- BatchSize::SmallInput,
- )
- });
-
- c.bench_with_input(BenchmarkId::new("part2", size), size, |b, &n| {
- b.iter_batched_ref(
- || (gen_random_tops(&mut rng, n), gen_random_moves(&mut rng, n)),
- |(tops, moves)| {
- for mv in moves {
- perform_move_9001(tops, *mv);
- }
- },
- BatchSize::SmallInput,
- )
- });
- }
-}
-
-criterion_group!(
- name = benches;
- config = Criterion::default().sample_size(10);
- targets = run_benches
-);
-criterion_main!(benches);