Open Veykril opened 2 weeks ago
For some additional context from Zulip, the current single-threaded loading behavior is especially problematic on EdenFS, which really wants tooling to send as many IO requests as possible in parallel.
this is a separate issue that we should fix, that is wait with that until all files are loaded into memory.
I did some rough, back-of-napkin benchmarking on this: rust-analyzer spends 5 seconds waiting on rustc
for every 100 crates it loads (just printed Instant::elapsed::as_millis
...). Given that total crate dependency graphs of over 1000 are not uncommon for larger Rust projects in the wild, it's likely that people are unnecessarily waiting for over a minute.
What makes this fix a little more complicated is that during project loading, there isn't a clear end-state: rust-analyzer just sorta repeatedly calls GlobalState::fetch_workspaces
.
We currently load them from a single thread which can make startup very slow for bigger projects as we re-query the project layout over and over again until all files are loaded (this is a separate issue that we should fix, that is wait with that until all files are loaded into memory).