mirror of
https://github.com/RussellChamp/advent-of-code-2024-rust.git
synced 2026-10-27 23:52:29 +00:00
update a few of the benchmarks
This commit is contained in:
1 parent
a037d203af
commit
6502e63efe
4 files changed
+16
-9
No files matched your search
@@ -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**
|
||||
<!--- benchmarking table --->
|
||||
|
||||
---
|
||||
|
||||
+2
-2
@@ -27,7 +27,7 @@ pub fn part_one(input: &str) -> Option<u32> {
|
||||
};
|
||||
|
||||
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<u32> {
|
||||
}
|
||||
}
|
||||
|
||||
println!("Made it out!");
|
||||
// println!("Made it out!");
|
||||
|
||||
Some(count_spaces(visited) as u32)
|
||||
}
|
||||
|
||||
+1
-1
@@ -9,7 +9,7 @@ pub fn part_one(input: &str) -> Option<u32> {
|
||||
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)
|
||||
}
|
||||
|
||||
+2
-2
@@ -72,14 +72,14 @@ pub fn part_two(input: &str) -> Option<u32> {
|
||||
}
|
||||
|
||||
let w = plots.iter().map(|p| p.iter().map(|p| p.letter).collect::<String>()).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
|
||||
});
|
||||
|
||||
|
||||
Reference in new issue
Block a user