-
Notifications
You must be signed in to change notification settings - Fork 1.8k
feat: Index workspace symbols at startup rather than on the first symbol search. #18180
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
This sounds fine to me but @davidbarsky might have opinions about this given this "slows down startup" |
I'll fix #18181 and rebase this PR against 18181, but I don't expect this to be PR to be an issue. As to why I care about startup times: at work, my team has some extremely detailed telemetry concerning people's usage of rust-analyzer and we've found that people want to start using rust-analyzer immediately after opening a Rust file, so faster startup times are a good thing. However, prior changes that increased cache priming times to reduce the number of uncached items also helped perceived despite nominally longer startup times. The general tenor of written/survey feedback from people is that while they wish they didn't need to wait for rust-analyzer to start, they found that the steady-state, warm rust-analyzer is heads-and-shoulders better than any other supported language's LSP. (I should probably write this down somewhere more permanent. Maybe a blog post?) |
FWIW, my personal motivation for this change is broadly like:
And even if the symbol search isn't the first interaction overall, the delay on the first search is still a significant factor since jumping to a symbol is often an important task right in the middle of “having a thought”. I expect that this aligns well with @davidbarsky’s goals. |
It aligns with my goals, yeah. I rebased your changes locally against my tracing changes and saw that |
@bors r+ |
☀️ Test successful - checks-actions |
This will eliminate potential many-second delays when performing the first search, at the price of making cache priming (“Indexing N/M” in the VS Code status bar) take a little longer in total. Hopefully this additional time is insignificant because a typical session will involve at least one symbol search.
Further improvement would be to do this as a separate parallel task (which will be beneficial if the workspace contains a small number of large crates), but that would require significant additional refactoring of the progress-reporting mechanism to understand multiple tasks per crate. Happy to tackle that in this PR if desired, but I thought I'd propose the minimal change first.