From 6502e63efe450334788dd1be588a9b73619839fa Mon Sep 17 00:00:00 2001 From: Russell Champoux Date: Fri, 13 Dec 2024 16:24:00 +0000 Subject: [PATCH] update a few of the benchmarks --- README.md | 15 +++++++++++---- src/bin/06.rs | 4 ++-- src/bin/11.rs | 2 +- src/bin/12.rs | 4 ++-- 4 files changed, 16 insertions(+), 9 deletions(-) diff --git a/README.md b/README.md index a239105..ace3459 100644 --- a/README.md +++ b/README.md @@ -27,11 +27,18 @@ Solutions for [Advent of Code](https://adventofcode.com/) in [Rust](https://www. | Day | Part 1 | Part 2 | | :---: | :---: | :---: | -| [Day 1](./src/bin/01.rs) | `153.0µs` | `237.3µs` | -| [Day 2](./src/bin/02.rs) | `205.7µs` | `530.7µs` | -| [Day 3](./src/bin/03.rs) | `615.8µs` | `743.8µs` | +| [Day 1](./src/bin/01.rs) | `131.2µs` | `206.6µs` | +| [Day 2](./src/bin/02.rs) | `179.9µs` | `474.6µs` | +| [Day 3](./src/bin/03.rs) | `465.1µs` | `666.7µs` | +| [Day 4](./src/bin/04.rs) | `3.4ms` | `476.1µs` | +| [Day 6](./src/bin/06.rs) | `65.5µs` | `-` | +| [Day 7](./src/bin/07.rs) | `12.2ms` | `-` | +| [Day 8](./src/bin/08.rs) | `109.7µs` | `-` | +| [Day 9](./src/bin/09.rs) | `1.1ms` | `-` | +| [Day 10](./src/bin/10.rs) | `5.7ms` | `-` | +| [Day 13](./src/bin/13.rs) | `2.9ms` | `-` | -**Total: 2.49ms** +**Total: 28.08ms** --- diff --git a/src/bin/06.rs b/src/bin/06.rs index a540dff..09facdf 100644 --- a/src/bin/06.rs +++ b/src/bin/06.rs @@ -27,7 +27,7 @@ pub fn part_one(input: &str) -> Option { }; loop { - println!("At {:?} going {:?}", pos, dir); + // println!("At {:?} going {:?}", pos, dir); let new_pos = (pos.0 + dir.0, pos.1 + dir.1); if !is_valid_position(new_pos) { break } @@ -46,7 +46,7 @@ pub fn part_one(input: &str) -> Option { } } - println!("Made it out!"); + // println!("Made it out!"); Some(count_spaces(visited) as u32) } diff --git a/src/bin/11.rs b/src/bin/11.rs index d124df9..2037234 100644 --- a/src/bin/11.rs +++ b/src/bin/11.rs @@ -9,7 +9,7 @@ pub fn part_one(input: &str) -> Option { step_stones(&mut stones, 25); let total_count = stones.len(); - println!("FINAL STONES: {:?} stones", total_count); + // println!("FINAL STONES: {:?} stones", total_count); Some(total_count as u32) } diff --git a/src/bin/12.rs b/src/bin/12.rs index a28abc1..5311040 100644 --- a/src/bin/12.rs +++ b/src/bin/12.rs @@ -72,14 +72,14 @@ pub fn part_two(input: &str) -> Option { } let w = plots.iter().map(|p| p.iter().map(|p| p.letter).collect::()).join("\n"); - println!("{}", w); + // println!("{}", w); let total = regions.iter().sorted_by_key(|r| r.0).fold(0, |sum, (region_id, region)| { let start_plot = find_plot(&plots, |p| p.region_id == Some(*region_id)).unwrap(); print!("REGION {}:", region.id); let edges = traverse_start(&plots, &start_plot); let total = sum + (region.count * edges); - println!(" = {} * {} = {}", region.count, edges, region.count * edges); + // println!(" = {} * {} = {}", region.count, edges, region.count * edges); total });