-
Notifications
You must be signed in to change notification settings - Fork 1.7k
100% system load on macOS Catalina (too eager incorrect case diagnostic) #6433
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
Comments
Does it happen on a specific project? |
You might be able to use Instruments (?) to see what it's doing, but most likely it's |
It happens while I'm editing a rust file (of a bigger project) in VSCode. Yes, I can check with Instruments. Any special wish what I should examine? |
No, I'm not familiar with the app. |
Ok, I have now checked with activity monitor. The fan of the system is completely off, if VSCode and the rust script is not on top of the desk, but the fan immediately begins to roar and the load is up to 100% for rust-analyzer-mac, once I just hit "Enter" in the window. With every editing step I see a "cargo check" running in the lower status line. Making a snapshot of what happens over 2.5 secs finds rust-analyzer-mac having about 20 threads running, most of them hanging in "wait" for a mutex, but at least one is very active with sort of grammar analysis whereas most the time is spend in "ide_db::search::FindUsages:" Does that make sense? |
So it looks like an "incorrect case" assist is trying to compute a fix and needs to find all references to a name in order to do that. @matklad I thought assists were resolved lazily, on request?
I never noticed that. Do you have auto-saving enabled? |
Huh, excellent catch! Those are diagnostics, and they are not resolved lazily. We probably should lazy-ifiy that, cc @popzxc |
Yes, this is enabled. |
Huh, I'll check what I can do. |
I think I identified the cause (thanks for the call graph!) and will send a fix today. |
Looking forward :) Good luck |
@neilyoung you have two options:
|
Another option is to compile binary via |
I was following this advice and nothing seemed to have changed, even though VSCode reacting on this change. However, a complete restart of VSCode with the new analyzer in the path definitely switched off my fans. Thanks for the quick fix |
Yeah, you have to restart the language server (there's a command for it) or reload the window for it to take effect. |
I did of course. In fact this was offered by VSC on detecting that I was tempering the config... Didn't help |
Anyway, the fan is silent. You can close this issue |
Not until PR with the fix is merged, I believe :) |
OK, sure. No problem |
I noticed that the analyzer annotations are less obtrusive (what is great) now. Is this also something you did in your code? |
Commenting mostly to add a cross-reference to issue #5344, since while they don’t seem to be related, until I actually reviewed my sampling data I wasn’t able to find this ticket due to the title using the term “system load” instead of “CPU”. GH issues doesn’t currently show this issue for searches like “high CPU” or “100% CPU”. Hopefully this helps others to find this ticket when they run into this problem. A workaround is to add |
Closing in favor of #8268 |
...caused by a process
rust-analyzer-mac
.Any idea how to throttle that?
The text was updated successfully, but these errors were encountered: