Parallelize DFS, use an AtomicBool for short-circuiting

time:   [73.407 µs 76.145 µs 79.345 µs]
change: [−40.126% −24.679% −3.8062%] (p = 0.04 < 0.05)
This commit is contained in:
2026-02-01 22:53:04 +02:00
parent c9e1d3ab67
commit 98cb9f7f3e
6 changed files with 375 additions and 5 deletions

View File

@@ -113,6 +113,16 @@ impl Default for Slot {
}
}
impl From<u8> for Slot {
fn from(value: u8) -> Self {
let mut slot = Slot::default();
for _ in 0..value {
slot = slot.next()
}
slot
}
}
#[derive(Serialize, Deserialize, PartialEq, PartialOrd, Ord, Eq, Debug, Hash, Clone, Copy)]
#[serde(rename_all = "camelCase")]
pub struct Day(pub u8);