From 658b96b201980d63da2a4a1602e9a7f616cf147c Mon Sep 17 00:00:00 2001 From: Sara Gerretsen Date: Tue, 23 Sep 2025 14:25:08 +0200 Subject: [PATCH] feat: set task split to hardware_concurrency() --- src/simulation.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/simulation.cpp b/src/simulation.cpp index f581901..e50de58 100644 --- a/src/simulation.cpp +++ b/src/simulation.cpp @@ -166,7 +166,8 @@ static void PopulateChanges() { static bool first_run{ true }; #if SIM_MULTITHREADING BlockUntilTasksDone(); - constexpr size_t split{ 4 }; + // for some reason three tasks per thread is faster than one task per thread, i don't get it either + size_t const split{ std::thread::hardware_concurrency() }; if (first_run) { first_run = false; born.resize(split);