Skip to content
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

Rust-analyzer hangs for more than 1 minute after indexing before responding to LSP requests #18969

Open
stormshield-kg opened this issue Jan 18, 2025 · 3 comments
Labels
C-bug Category: bug

Comments

@stormshield-kg
Copy link

stormshield-kg commented Jan 18, 2025

Logs output using RA_PROFILE='*>10': log1.txt
Logs output using RA_PROFILE='*: log2.txt

Perf run showing the problem (viewable using Firefox profiler): perf.tar.gz
The first 30s are the indexing time, then rust-analyzer hangs for 75s when trying to hover a struct or go to its definition.

rust-analyzer version: v0.4.2270
rustc version: rustc 1.83.0 (90b35a623 2024-11-26)

editor or extension: VSCode 1.96.3 with rust-analyzer extension v0.4.2270

Reproduction: This problem occurs on a private repository which I cannot share. It uses diesel extensively.

@stormshield-kg stormshield-kg added the C-bug Category: bug label Jan 18, 2025
@ChayimFriedman2
Copy link
Contributor

ChayimFriedman2 commented Jan 18, 2025

It doesn't seem to hang, just doing a lot of work. Indexing isn't the end of the story; it doesn't do all the work (nor it should). And diesel is known to use the trait solver extensively. So I believe this is unactionable.

Do next hovers also take that long?

@stormshield-kg
Copy link
Author

Next hovers are fast only if the code doesn't change, but they are slow again after any code modification.

@stormshield-kg
Copy link
Author

stormshield-kg commented Jan 18, 2025

The slowdown didn't occur several months ago, so it might be caused by a relatively recent change in rust-analyzer.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-bug Category: bug
Projects
None yet
Development

No branches or pull requests

2 participants