Skip to content

Commit

Permalink
Longer pre-search is better for rayon
Browse files Browse the repository at this point in the history
  • Loading branch information
kcaffrey committed Dec 23, 2023
1 parent cffbc83 commit 8ee35bb
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,9 +61,9 @@ Solutions for [Advent of Code](https://adventofcode.com/) in [Rust](https://www.
| [Day 20](./src/bin/20.rs) | `323.9µs` | `1.2ms` |
| [Day 21](./src/bin/21.rs) | `64.1µs` | `494.7µs` |
| [Day 22](./src/bin/22.rs) | `78.3µs` | `194.8µs` |
| [Day 23](./src/bin/23.rs) | `331.0µs` | `19.6ms` |
| [Day 23](./src/bin/23.rs) | `330.4µs` | `13.3ms` |

**Total: 36.54ms**
**Total: 30.24ms**
<!--- benchmarking table --->

---
Expand Down
2 changes: 1 addition & 1 deletion src/bin/23.rs
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ pub fn part_two(input: &str) -> Option<u16> {
start = trim(start);

// Find all paths to depth N iteratively to use rayon on the resulting paths.
const PRESEARCH_DEPTH: u8 = 2;
const PRESEARCH_DEPTH: u8 = 8;
let mut paths = Vec::new();
let mut stack = Vec::new();
stack.push((start, 1u64 << start, 0, 0));
Expand Down

0 comments on commit 8ee35bb

Please sign in to comment.