advent-of-code/aoc2021/aoc2021_bench/benches/aoc2021_bench.rs

25 lines
783 B
Rust
Raw Normal View History

2021-11-25 16:49:52 +01:00
use criterion::{criterion_group, criterion_main, Criterion};
2021-12-01 07:39:21 +01:00
use aoc2021::day01;
2021-12-03 15:36:54 +01:00
use aoc2021::day02;
2021-12-03 15:37:58 +01:00
use aoc2021::day03;
2021-12-04 14:55:56 +01:00
use aoc2021::day04;
2021-12-05 17:05:48 +01:00
use aoc2021::day05;
2021-12-06 11:25:08 +01:00
use aoc2021::day06;
2021-11-25 16:49:52 +01:00
fn aoc2021_all(c: &mut Criterion) {
2021-12-01 07:39:21 +01:00
c.bench_function("day01", |b| b.iter(|| day01::run().unwrap()));
2021-12-03 15:36:54 +01:00
c.bench_function("day02", |b| b.iter(|| day02::run().unwrap()));
2021-12-03 15:37:58 +01:00
c.bench_function("day03", |b| b.iter(|| day03::run().unwrap()));
2021-12-04 14:55:56 +01:00
c.bench_function("day04", |b| b.iter(|| day04::run().unwrap()));
2021-12-05 17:05:48 +01:00
c.bench_function("day05", |b| b.iter(|| day05::run().unwrap()));
2021-12-06 11:25:08 +01:00
c.bench_function("day06", |b| b.iter(|| day06::run().unwrap()));
2021-11-25 16:49:52 +01:00
}
criterion_group! {
name = all_days;
config = Criterion::default().sample_size(200);
targets = aoc2021_all
}
criterion_main!(all_days);