2022: day 01 part 1
This commit is contained in:
parent
a5fd485c10
commit
f3f3b40d47
12 changed files with 2415 additions and 6 deletions
17
aoc2022/aoc2022_bench/Cargo.toml
Normal file
17
aoc2022/aoc2022_bench/Cargo.toml
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
[package]
|
||||
name = "aoc2022_bench"
|
||||
version = "0.1.0"
|
||||
authors = ["Antoine Martin <antoine@alarsyo.net>"]
|
||||
edition = "2021"
|
||||
|
||||
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
||||
|
||||
[dependencies]
|
||||
aoc2022 = { path = "../" }
|
||||
|
||||
[dev-dependencies]
|
||||
criterion = "0.3"
|
||||
|
||||
[[bench]]
|
||||
name = "aoc2022_bench"
|
||||
harness = false
|
||||
14
aoc2022/aoc2022_bench/benches/aoc2022_bench.rs
Normal file
14
aoc2022/aoc2022_bench/benches/aoc2022_bench.rs
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
use criterion::{criterion_group, criterion_main, Criterion};
|
||||
|
||||
use aoc2022::day01;
|
||||
|
||||
fn aoc2022_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 = aoc2022_all
|
||||
}
|
||||
criterion_main!(all_days);
|
||||
Loading…
Add table
Add a link
Reference in a new issue