Reduce amount of foreground tasks spawned on multibuffer/editor updates (#41479)

When doing a project wide search in zed on windows for `hang`, zed
starts to freeze for a couple seconds ultimately starting to error with
`Not enough quota is available to process this command.` when
dispatching windows messages. The cause for this is that we simply
overload the windows message pump due to the sheer amount of foreground
tasks we spawn when we populate the project search.

This PR is an attempt at reducing this.

Release Notes:

- Reduced hangs and stutters in large project file searches
This commit is contained in:
Lukas Wirth
2025-10-30 17:40:56 +00:00
committed by GitHub
parent 743180342a
commit ac3b232dda
13 changed files with 101 additions and 86 deletions
+1
View File
@@ -602,6 +602,7 @@ impl GitBlame {
}
fn regenerate_on_edit(&mut self, cx: &mut Context<Self>) {
// todo(lw): hot foreground spawn
self.regenerate_on_edit_task = cx.spawn(async move |this, cx| {
cx.background_executor()
.timer(REGENERATE_ON_EDIT_DEBOUNCE_INTERVAL)