aoc_3
This commit is contained in:
@@ -14,7 +14,14 @@ fn bench_aoc_1_part2(c: &mut Criterion) {
|
||||
|
||||
fn bench_aoc_1_part2_f(c: &mut Criterion) {
|
||||
let input = black_box(include_bytes!("../src/aoc/input/full_input_aoc1.txt"));
|
||||
c.bench_function("bench_aoc2 part fast", |b| b.iter(|| aoc_1::solve_2f(input)));
|
||||
c.bench_function("bench_aoc2 part fast", |b| {
|
||||
b.iter(|| aoc_1::solve_2f(input))
|
||||
});
|
||||
}
|
||||
criterion_group!(benches_p1, bench_aoc_1_part1, bench_aoc_1_part2, bench_aoc_1_part2_f);
|
||||
criterion_group!(
|
||||
benches_p1,
|
||||
bench_aoc_1_part1,
|
||||
bench_aoc_1_part2,
|
||||
bench_aoc_1_part2_f
|
||||
);
|
||||
criterion_main!(benches_p1);
|
||||
|
||||
@@ -7,10 +7,29 @@ fn bench_aoc_2_part1(c: &mut Criterion) {
|
||||
c.bench_function("bench_aoc2 part 1", |b| b.iter(|| aoc_2::solve_p1(input)));
|
||||
}
|
||||
|
||||
fn bench_aoc_2_part1_f(c: &mut Criterion) {
|
||||
let input = black_box(include_str!("../src/aoc/input/full_input_aoc2.txt"));
|
||||
c.bench_function("bench_aoc2 part 1 fast", |b| {
|
||||
b.iter(|| aoc_2::solve_p1_unsafe(input))
|
||||
});
|
||||
}
|
||||
fn bench_aoc_2_part1_faster(c: &mut Criterion) {
|
||||
let input = black_box(include_bytes!("../src/aoc/input/full_input_aoc2.txt"));
|
||||
c.bench_function("bench_aoc2 part 1 faster", |b| {
|
||||
b.iter(|| aoc_2::solve_p1_bytes(input))
|
||||
});
|
||||
}
|
||||
|
||||
fn bench_aoc_2_part2(c: &mut Criterion) {
|
||||
let input = black_box(include_str!("../src/aoc/input/full_input_aoc2.txt"));
|
||||
c.bench_function("bench_aoc2 part 1", |b| b.iter(|| aoc_2::solve_p2(input)));
|
||||
}
|
||||
|
||||
criterion_group!(benches_p2, bench_aoc_2_part1, bench_aoc_2_part2);
|
||||
criterion_main!(benches_p2);
|
||||
criterion_group!(
|
||||
benches_p2,
|
||||
bench_aoc_2_part1,
|
||||
bench_aoc_2_part1_f,
|
||||
bench_aoc_2_part1_faster,
|
||||
bench_aoc_2_part2
|
||||
);
|
||||
criterion_main!(benches_p2);
|
||||
|
||||
35
benches/bench_aoc_3.rs
Normal file
35
benches/bench_aoc_3.rs
Normal file
@@ -0,0 +1,35 @@
|
||||
use aoc2025::aoc::aoc_3;
|
||||
use criterion::{Criterion, criterion_group, criterion_main};
|
||||
use std::hint::black_box;
|
||||
|
||||
fn bench_aoc_3_part1(c: &mut Criterion) {
|
||||
let input = black_box(include_bytes!("../src/aoc/input/full_input_aoc3.txt"));
|
||||
c.bench_function("bench_aoc3 part 1", |b| b.iter(|| aoc_3::solve_p1(input)));
|
||||
}
|
||||
fn bench_aoc_3_part1_fast(c: &mut Criterion) {
|
||||
let input = black_box(include_bytes!("../src/aoc/input/full_input_aoc3.txt"));
|
||||
c.bench_function("bench_aoc3 part 1 fast", |b| {
|
||||
b.iter(|| aoc_3::solve_p1_fast(input))
|
||||
});
|
||||
}
|
||||
|
||||
fn bench_aoc_3_part2(c: &mut Criterion) {
|
||||
let input = black_box(include_bytes!("../src/aoc/input/full_input_aoc3.txt"));
|
||||
c.bench_function("bench_aoc3 part 2", |b| b.iter(|| aoc_3::solve_p2(input)));
|
||||
}
|
||||
|
||||
fn bench_aoc_3_part2_fast(c: &mut Criterion) {
|
||||
let input = black_box(include_bytes!("../src/aoc/input/full_input_aoc3.txt"));
|
||||
c.bench_function("bench_aoc3 part 2 fast", |b| {
|
||||
b.iter(|| aoc_3::solve_p2_fast(input))
|
||||
});
|
||||
}
|
||||
|
||||
criterion_group!(
|
||||
benches_p3,
|
||||
bench_aoc_3_part1,
|
||||
bench_aoc_3_part1_fast,
|
||||
bench_aoc_3_part2,
|
||||
bench_aoc_3_part2_fast
|
||||
);
|
||||
criterion_main!(benches_p3);
|
||||
Reference in New Issue
Block a user