From d213e04c11789052ad91e5909d5cdf8587636657 Mon Sep 17 00:00:00 2001 From: Bill Thiede Date: Wed, 1 Feb 2023 14:18:21 -0800 Subject: [PATCH] rtiow: default thread count to half the cores. This seems to be faster than using both HT buddies. --- rtiow/renderer/src/renderer.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/rtiow/renderer/src/renderer.rs b/rtiow/renderer/src/renderer.rs index c95f357..f73d32f 100644 --- a/rtiow/renderer/src/renderer.rs +++ b/rtiow/renderer/src/renderer.rs @@ -501,7 +501,8 @@ fn render_worker( } pub fn render(scene: Scene, output_dir: &Path) -> std::result::Result<(), std::io::Error> { - let num_threads = scene.num_threads.unwrap_or_else(num_cpus::get); + // Default to half the cores to disable hyperthreading. + let num_threads = scene.num_threads.unwrap_or_else(|| num_cpus::get() / 2); let (pixel_req_tx, pixel_req_rx) = sync_channel(2 * num_threads); let (pixel_resp_tx, pixel_resp_rx) = sync_channel(2 * num_threads);