From e49e9b5ff779d95d749761bc5186323e9524c405 Mon Sep 17 00:00:00 2001 From: jacekpoz Date: Fri, 8 Dec 2023 13:24:10 +0100 Subject: [PATCH] speed up execution from 11 to 5 seconds --- src/main.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main.rs b/src/main.rs index 64617ad..60f22ff 100644 --- a/src/main.rs +++ b/src/main.rs @@ -163,7 +163,7 @@ fn main() -> anyhow::Result<()> { let cpu = cpu.clone(); let results = Arc::clone(&results); let handle = thread::spawn(move || { - for n in ((1000 + cpu * 1000)..=100000).step_by(1000 + cpu * 1000) { + for n in ((1000 + cpu * 1000)..=100000).step_by(1000 * num_cpus) { if results.read().expect("can't read results map").get(&(n as u64)).is_some() { continue; }