remove diagnostics update benchmarks

This commit is contained in:
RussellChamp committed 2024-12-13 20:43:46 +00:00
1 parent 680c9547e4
commit 54c5667958
2 files changed
+26 -26

No files matched your search

+20 -20
View File
@@ -24,26 +24,26 @@ Solutions for [Advent of Code](https://adventofcode.com/) in [Rust](https://www.
| [Day 12](https://adventofcode.com/2024/day/12) | ⭐ | | | [Day 12](https://adventofcode.com/2024/day/12) | ⭐ | |
<!--- advent_readme_stars table ---> <!--- advent_readme_stars table --->
<!--- benchmarking table ---> <!--- benchmarking table --->
## Benchmarks ## Benchmarks
| Day | Part 1 | Part 2 | | Day | Part 1 | Part 2 |
| :---: | :---: | :---: | | :---: | :---: | :---: |
| [Day 1](./src/bin/01.rs) | `126.9µs` | `218.4µs` | | [Day 1](./src/bin/01.rs) | `126.9µs` | `218.4µs` |
| [Day 2](./src/bin/02.rs) | `190.5µs` | `487.3µs` | | [Day 2](./src/bin/02.rs) | `190.5µs` | `487.3µs` |
| [Day 3](./src/bin/03.rs) | `524.3µs` | `678.5µs` | | [Day 3](./src/bin/03.rs) | `524.3µs` | `678.5µs` |
| [Day 4](./src/bin/04.rs) | `3.7ms` | `495.5µs` | | [Day 4](./src/bin/04.rs) | `3.7ms` | `495.5µs` |
| [Day 5](./src/bin/05.rs) | `43.2ms` | `-` | | [Day 5](./src/bin/05.rs) | `43.2ms` | `-` |
| [Day 6](./src/bin/06.rs) | `59.8µs` | `-` | | [Day 6](./src/bin/06.rs) | `59.8µs` | `-` |
| [Day 7](./src/bin/07.rs) | `11.9ms` | `-` | | [Day 7](./src/bin/07.rs) | `11.9ms` | `-` |
| [Day 8](./src/bin/08.rs) | `106.2µs` | `-` | | [Day 8](./src/bin/08.rs) | `106.2µs` | `-` |
| [Day 9](./src/bin/09.rs) | `1.0ms` | `-` | | [Day 9](./src/bin/09.rs) | `1.0ms` | `-` |
| [Day 10](./src/bin/10.rs) | `10.1ms` | `-` | | [Day 10](./src/bin/10.rs) | `10.1ms` | `-` |
| [Day 11](./src/bin/11.rs) | `1.9s` | `-` | | [Day 11](./src/bin/11.rs) | `1.9s` | `-` |
| [Day 12](./src/bin/12.rs) | `4.5ms` | `-` | | [Day 12](./src/bin/12.rs) | `4.5ms` | `-` |
| [Day 13](./src/bin/13.rs) | `3.1ms` | `-` | | [Day 13](./src/bin/13.rs) | `2.7ms` | `719.8µs` |
**Total: 1980.39ms** **Total: 1980.71ms**
<!--- benchmarking table ---> <!--- benchmarking table --->
--- ---
+6 -6
View File
@@ -69,7 +69,7 @@ pub fn part_two(input: &str) -> Option<u64> {
Machine { a_button, b_button, prize } Machine { a_button, b_button, prize }
}).collect_vec(); }).collect_vec();
println!("PROCESSING {} MACHINES", machines.len()); // println!("PROCESSING {} MACHINES", machines.len());
let wins = machines.iter().filter_map(|Machine { a_button, b_button, prize }| { let wins = machines.iter().filter_map(|Machine { a_button, b_button, prize }| {
let denom = (a_button.x * b_button.y) - (a_button.y * b_button.x ); let denom = (a_button.x * b_button.y) - (a_button.y * b_button.x );
@@ -77,23 +77,23 @@ pub fn part_two(input: &str) -> Option<u64> {
let b_numer = (prize.y * a_button.x) - (prize.x * a_button.y); let b_numer = (prize.y * a_button.x) - (prize.x * a_button.y);
if a_numer % denom != 0 || b_numer % denom != 0 { if a_numer % denom != 0 || b_numer % denom != 0 {
print!("❌"); // print!("❌");
return None; return None;
} }
let a_presses = a_numer / denom; let a_presses = a_numer / denom;
let b_presses = b_numer / denom; let b_presses = b_numer / denom;
print!("✔️ "); // print!("✔️ ");
Some(3 * a_presses + b_presses) Some(3 * a_presses + b_presses)
// println!("MATCHES {:?}", matches); // println!("MATCHES {:?}", matches);
}).collect_vec(); }).collect_vec();
println!(); // println!();
println!("WON {} PRIZES!", wins.len()); // println!("WON {} PRIZES!", wins.len());
let total_tokens: isize = wins.into_iter().sum(); let total_tokens: isize = wins.into_iter().sum();
println!("COST {} TOKENS!", total_tokens); // println!("COST {} TOKENS!", total_tokens);
Some(total_tokens as u64) Some(total_tokens as u64)
} }