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:
Piotr Osiewicz
2025-10-16 14:49:34 +02:00
committed by GitHub
co-authored by Smit Barmase
parent 9c70ba7dcc
commit c37a2f885a
13 changed files with 432 additions and 188 deletions
+2 -1
View File
@@ -222,7 +222,7 @@ members = [
"tooling/perf",
"tooling/workspace-hack",
"tooling/xtask",
"tooling/xtask", "crates/fs_benchmarks", "crates/worktree_benchmarks",
]
default-members = ["crates/zed"]
@@ -455,6 +455,7 @@ async-compat = "0.2.1"
async-compression = { version = "0.4", features = ["gzip", "futures-io"] }
async-dispatcher = "0.1"
async-fs = "2.1"
async-lock = "2.1"
async-pipe = { git = "https://github.com/zed-industries/async-pipe-rs", rev = "82d00a04211cf4e1236029aa03e6b6ce2a74c553" }
async-recursion = "1.0.0"
async-tar = "0.5.0"