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

31 lines
1 KiB
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-12-07 11:06:16 +01:00
use aoc2021::day07;
2021-12-08 19:45:40 +01:00
use aoc2021::day08;
2021-12-09 20:03:56 +01:00
use aoc2021::day09;
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-12-07 11:06:16 +01:00
c.bench_function("day07", |b| b.iter(|| day07::run().unwrap()));
2021-12-08 19:45:40 +01:00
c.bench_function("day08", |b| b.iter(|| day08::run().unwrap()));
2021-12-09 20:03:56 +01:00
c.bench_function("day09", |b| b.iter(|| day09::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);