pucelle / vscode-css-navigation

Allowing Go to definition from HTML to CSS, or Find References from CSS to HTML.
https://marketplace.visualstudio.com/items?itemName=pucelle.vscode-css-navigation
MIT License
64 stars 8 forks source link

Process appears to hang and consume CPU #84

Closed diegovogel closed 8 months ago

diegovogel commented 1 year ago

I noticed recently that the battery life on my laptop was abysmal compared to what it used to be (went from 100% to 10% in 3 hours). After some digging, I found a couple processes from this extension were constantly using ~100% CPU, and the total CPU time for those two processes was 12 times higher than the next highest process. I quit the processes, restarted VS Code, edited some files to test, and the CPU usage seems to be back to normal for now. So it seems as though those processes were stuck in a state of extremely high CPU usage.

I'll keep an eye on it to see if it happens again. Is there anything else I can do to help debug if this happens again?

image

image

pucelle commented 1 year ago

HI, diegovogel, sorry to reply you late. This issue may exist, and it would be very hard to exam, you may try:

  1. The most possible place where this issue may happen is File Tracking module, especially when having more than 10k+ files in a workspace. please help to check whether you have great many files in your workspace.

  2. You may open vscode output, it's here: image check the output when this issue happen again, if the output is totally stuck, no any message output when you doing finding definition or completion, the this is definitely an Infinite-CPU-Usage issue.

diegovogel commented 1 year ago

@pucelle thanks for the follow-up. All my projects only have a few hundred files. The biggest one has about 700. Sometimes I have multiple projects open at once, but I don't think I would've reached 10K files.

I've switched from VS Code to PHPStorm. But if I go back to VSC and have this problem again I'll check the output.

pucelle commented 1 year ago

OK, thanks.