Add criterion benchmarking

zoom zoom
This commit is contained in:
2025-12-02 22:04:05 -05:00
parent 952a851b41
commit e490bc99f5
6 changed files with 496 additions and 4 deletions

View File

@@ -6,7 +6,7 @@ use color_eyre::{
};
use tracing::{debug, info, instrument};
const INPUT: &str = include_str!("input/input.txt");
pub const INPUT: &str = include_str!("input/input.txt");
const LOCK_SIZE: i32 = 100;
const LOCK_STARTING_POSITION: i32 = 50;
@@ -30,7 +30,7 @@ impl FromStr for Direction {
}
#[instrument(skip(input))]
fn part1(input: &str) -> Result<i32> {
pub fn part1(input: &str) -> Result<i32> {
let mut dial = LOCK_STARTING_POSITION;
let mut visited_zero_count = 0;
for line in input.trim().split('\n') {
@@ -57,7 +57,7 @@ fn part1(input: &str) -> Result<i32> {
}
#[instrument(skip(input))]
fn part2(input: &str) -> Result<i32> {
pub fn part2(input: &str) -> Result<i32> {
let mut dial = LOCK_STARTING_POSITION;
let mut visited_zero_count = 0;
for line in input.trim().split('\n') {

1
src/lib.rs Normal file
View File

@@ -0,0 +1 @@
pub mod day01;