diff --git a/crates/remote_server/src/unix.rs b/crates/remote_server/src/unix.rs index 29e5ef735f5a001c23e3215c1a3fc5d291830282..c631d47b8c2cea5d2ed74cd6ce8bd2956c3fbb1a 100644 --- a/crates/remote_server/src/unix.rs +++ b/crates/remote_server/src/unix.rs @@ -373,7 +373,7 @@ pub fn execute_run( let listeners = ServerListeners::new(stdin_socket, stdout_socket, stderr_socket)?; rayon::ThreadPoolBuilder::new() - .num_threads(4) + .num_threads(std::thread::available_parallelism().map_or(1, |n| n.get().div_ceil(2))) .stack_size(10 * 1024 * 1024) .thread_name(|ix| format!("RayonWorker{}", ix)) .build_global() diff --git a/crates/zed/src/main.rs b/crates/zed/src/main.rs index 9dba1b427d35db3e236e166b5a90984deca1747b..89944f835b0c7905145b3c6c0df13a20c78f37b8 100644 --- a/crates/zed/src/main.rs +++ b/crates/zed/src/main.rs @@ -265,7 +265,7 @@ pub fn main() { } rayon::ThreadPoolBuilder::new() - .num_threads(4) + .num_threads(std::thread::available_parallelism().map_or(1, |n| n.get().div_ceil(2))) .stack_size(10 * 1024 * 1024) .thread_name(|ix| format!("RayonWorker{}", ix)) .build_global()