From f8b414c22cdb52256a89e97f917fd387e657ba92 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 1ee239c3740bb0fba40f81b9cdae77a46d62d535..947d90338afea01f0096585c2b1fb74ac907bbf1 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -21233,6 +21233,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 9f6196c1482bcff2db9b7812dfb75b1471fec273..ebb3d8beb321cb6ee42cec84ddf7f456672a0265 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 b873a58d3b61338b25c5908c2f87b62acb95d6f6..18903d888090bbc1fa0955d46417486a3f9fe13b 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,