Multiple priority scheduler (#44575)

Improves the scheduler by allowing tasks to have a set priority which
will significantly improve responsiveness.

Release notes:

- N/A

---------

Co-authored-by: Yara <git@yara.blue>
This commit is contained in:
localcc
2025-12-11 13:22:39 +00:00
committed by GitHub
co-authored by Yara
parent 8572c19a02
commit 95dbc0efc2
24 changed files with 1111 additions and 154 deletions
+3 -2
View File
@@ -22,7 +22,8 @@ use git::{
COMMIT_MESSAGE, DOT_GIT, FSMONITOR_DAEMON, GITIGNORE, INDEX_LOCK, LFS_DIR, status::GitSummary,
};
use gpui::{
App, AppContext as _, AsyncApp, BackgroundExecutor, Context, Entity, EventEmitter, Task,
App, AppContext as _, AsyncApp, BackgroundExecutor, Context, Entity, EventEmitter, Priority,
Task,
};
use ignore::IgnoreStack;
use language::DiskState;
@@ -4123,7 +4124,7 @@ impl BackgroundScanner {
let progress_update_count = AtomicUsize::new(0);
self.executor
.scoped(|scope| {
.scoped_priority(Priority::Low, |scope| {
for _ in 0..self.executor.num_cpus() {
scope.spawn(async {
let mut last_progress_update_count = 0;