From a3f230f760b84f007d51af747fa4d7f27206a4d1 Mon Sep 17 00:00:00 2001 From: Lukas Wirth Date: Mon, 3 Nov 2025 13:28:32 +0100 Subject: [PATCH] zed: Reduce number of rayon threads, spawn with bigger stacks (#41812) We already do this for the cli and remote server but forgot to do so for the main binary Release Notes: - N/A *or* Added/Fixed/Improved ... --- Cargo.lock | 1 + crates/zed/Cargo.toml | 1 + crates/zed/src/main.rs | 7 +++++++ 3 files changed, 9 insertions(+) diff --git a/Cargo.lock b/Cargo.lock index c54d7f3e6a94dd7157dab3d3e81b02cffe260627..9c9de1bec527be83fb20afff688b845b9ccbafed 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -21204,6 +21204,7 @@ dependencies = [ "project_symbols", "prompt_store", "proto", + "rayon", "recent_projects", "release_channel", "remote", diff --git a/crates/zed/Cargo.toml b/crates/zed/Cargo.toml index 16f4df191606769c204cd23b41135088629faa3b..aecd64eda56ba5415c52a4857f865b3ab5244747 100644 --- a/crates/zed/Cargo.toml +++ b/crates/zed/Cargo.toml @@ -73,6 +73,7 @@ gpui = { workspace = true, features = [ "windows-manifest", ] } gpui_tokio.workspace = true +rayon.workspace = true edit_prediction_button.workspace = true http_client.workspace = true diff --git a/crates/zed/src/main.rs b/crates/zed/src/main.rs index 93feb4a71d18164501955b46187a14d6757d861e..07a6deb0a5e1895f53775d9d038ef007e07d2371 100644 --- a/crates/zed/src/main.rs +++ b/crates/zed/src/main.rs @@ -257,6 +257,13 @@ pub fn main() { return; } + rayon::ThreadPoolBuilder::new() + .num_threads(4) + .stack_size(10 * 1024 * 1024) + .thread_name(|ix| format!("RayonWorker{}", ix)) + .build_global() + .unwrap(); + log::info!( "========== starting zed version {}, sha {} ==========", app_version,