Has rust-analyzer been excruciatingly slow for you?

173 points realvolker1

Hey all

I have been working on a project with a bunch of crates, including some crates that usually take a long time to build, like gtk4, zbus, phf, etc. I am using (almost) the default rust-analyzer settings for the vscode extension.

I noticed that rust-analyzer has been taking a very long time on cargo fetch. I assume it is hitting some sort of timeout? I also notice it is taking a very long time rebuilding proc macros. Sometimes it just spins forever, and when I save the file, a little message pops up telling me it is waiting for the cargo check to finish so it can format and save the file. Often in this case I close the window (it auto saves the file) and then I have to kill rust-analyzer from the CLI. Then when I open the window again, it works.

I tried it in a new project with a few dependencies and I found it still took unusually long for rust-analyzer to get done checking, fetching, validating, etc.

The thing is, when I run cargo build from the CLI, it takes (what I would consider) a normal amount of time to build.

Do I have something configured wrong?

Edit: my computer has an i7 12650H CPU, 16gb DDR5 memory, and the nvme SSD that my projects are on is formatted with ext4. My internet is pretty decent.