rust-lang / rust-analyzer

A Rust compiler front-end for IDEs
https://rust-analyzer.github.io/
Apache License 2.0
14.38k stars 1.62k forks source link

Rust-analyzer freezes VS Code GUI when hovering over variable with long type #11679

Open Sagrel opened 2 years ago

Sagrel commented 2 years ago

I was testing a parser combinator library called chumsky and noticed that hovering over variables with very long types causes the whole VS Code to freeze for a couple of seconds before the pop up window appears. The CPU usage of VS Code jumps from 1% to 10% and the memory usage also spikes. The repository is this, as you can see it's quite a small project. To replicate the performance problems just go to the bottom of parser.rs and hover over "definition". My CPU is a AMD Ryzen 5 1600X 3.60Ghz and I have 8 GB of RAM. Here you can see a video of VS Code freezing

https://user-images.githubusercontent.com/31445649/157887042-8b1a2e34-2f5d-4843-906d-3b8fb48d0db9.mp4

D0bhareach commented 1 year ago

I use to have similar problem with rust-analyzer, usually when I open project with many dependencies. It used to freeze my system to point of non responding. In my case increase of a swap memory solved the problem.

ParnikaGupta9 commented 7 months ago

Same here