Stream: t-compiler/rust-analyzer

Topic: vscode 100% cpu

tdelabro (Apr 27 2021 at 21:36, on Zulip):

Hey, I'm using vscode with the rust-anlayzer and each time I run x check the whole computer freeze for a dozen of seconds after the execution is done, and the fan start making a lot of noise. I'm using mac os. Is there a way to avoid this ?

Laurențiu (Apr 28 2021 at 06:18, on Zulip):

Did you disable "check on save" in RA? That rustc process is either started by RA (for "check on save"), or by your ./ check. The other one (Code Renderer) is unrelated, does Code show anything new (maybe a lot of errors) when it starts working again?

Laurențiu (Apr 28 2021 at 06:23, on Zulip):

And can you also keep an eye on the available RAM?

tdelabro (Apr 28 2021 at 10:02, on Zulip):

Yes I disabled the check on save for RA. After some research I figured out that it was a common problem for vscode when working on huge repos ( and the only workaround was to exclude files from watch. So I added:

  "files.watcherExclude": {
    "**/build/**": true,
    "**/node_modules/**": true,
    "**/src/test/**": true,

to my settings.json and it's usable again. The pike over 100% cpu only last for less than a second now.
There is probably other folders I can exclude without ruining the coding experience.

matklad (Apr 28 2021 at 10:15, on Zulip):

heh, file watching is an unsolved problem. Porting watchman's design to Rust, such that it can work both as an external service and as a library, would be a big deal

Last update: Jul 27 2021 at 20:30UTC