fs: Replace a bunch of uses of smol::fs with manual impls (#40172)
smol::fs uses a separate threadpool, which is a bit yuck. This PR also added a benchmark you can use to run a full worktree scan (initial one, that is) for arbitrary worktree.. and refactored worktree scanner to use async locks, as otherwise tests were deadlocking. :) I've benchmarked it against Zed, Linux and Chromium and saw a ~60% drop in initial worktree scan times across the board. Release Notes: - Significantly (3.3x speedup over the old implementation) improved speed of Zed's worktree scanner, that's responsible for synchronizing the state of your project with the state of files on hard drive. --------- Co-authored-by: Smit Barmase <heysmitbarmase@gmail.com>
This commit is contained in:
co-authored by
Smit Barmase
parent
9c70ba7dcc
commit
c37a2f885a
@@ -734,7 +734,6 @@ async fn test_write_file(cx: &mut TestAppContext) {
|
||||
})
|
||||
.await
|
||||
.unwrap();
|
||||
|
||||
worktree.read_with(cx, |tree, _| {
|
||||
let tracked = tree
|
||||
.entry_for_path(rel_path("tracked-dir/file.txt"))
|
||||
@@ -1537,7 +1536,7 @@ async fn test_random_worktree_operations_during_initial_scan(
|
||||
assert_eq!(
|
||||
updated_snapshot.entries(true, 0).collect::<Vec<_>>(),
|
||||
final_snapshot.entries(true, 0).collect::<Vec<_>>(),
|
||||
"wrong updates after snapshot {i}: {snapshot:#?} {updates:#?}",
|
||||
"wrong updates after snapshot {i}: {updates:#?}",
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user