2025: setup bench for day01

This commit is contained in:
Antoine Martin 2025-12-02 17:44:22 +01:00
parent d310ec45c0
commit db1bae8a76
3 changed files with 22 additions and 0 deletions

1
Cargo.lock generated
View file

@ -139,6 +139,7 @@ version = "0.1.0"
dependencies = [
"anyhow",
"aoc",
"criterion 0.4.0",
]
[[package]]

View file

@ -8,9 +8,16 @@ edition = "2024"
aoc = { path = "../aoc" }
anyhow = "1.0"
[dev-dependencies]
criterion = { version = "0.4", default-features = false, features = [ "rayon" ] }
[lib]
path = "src/lib.rs"
[[bin]]
name = "aoc2025"
path = "src/main.rs"
[[bench]]
name = "aoc2025_bench"
harness = false

View file

@ -0,0 +1,14 @@
use criterion::{criterion_group, criterion_main, Criterion};
use aoc2025::day01;
fn aoc2025_all(c: &mut Criterion) {
c.bench_function("day01", |b| b.iter(|| day01::run().unwrap()));
}
criterion_group! {
name = all_days;
config = Criterion::default().sample_size(200);
targets = aoc2025_all
}
criterion_main!(all_days);