elm-language-client-vscode icon indicating copy to clipboard operation
elm-language-client-vscode copied to clipboard

Extension causes high cpu load

Open melston opened this issue 2 years ago • 8 comments

  • Issue Type: Performance
  • Extension Name: elm-ls-vscode
  • Extension Version: 2.2.0
  • OS Version: Windows_NT x64 10.0.19042
  • VS Code version: 1.58.2

Find more details here: https://github.com/microsoft/vscode/wiki/Explain-extension-causes-high-cpu-load

elmTooling.elm-ls-vscode-unresponsive.cpuprofile.txt

melston avatar Aug 01 '21 00:08 melston

I love this extension, but I don't like the fact it sometimes turns my laptop into a helicopter (if judge by sound).

One thing I also found is that besides unresponsive language server, there is another source of high CPU load: rg ran by the extensions at start. It recursively searches for elm.json files in the project folder, causing up to 1200% CPU load on my computer. So, this what happens when I open ~/ via Visual Studio Code: bildo

I guess some kind of recursion limit must be introduced in order to stop extension from searching for nonexistent elm.json in folder with a huge number of files.

gardspirito avatar Dec 11 '21 10:12 gardspirito

Снимок экрана 2022-01-20 в 1 20 43 PM

Facing a similar issue on macOS Monterey. My Apple M1 laptop becomes hot when editing Elm files in VSCode. System Monitor shows 100% CPU load on Electron process, and if I inspect details I see that this process works with Elm project.

geraldus avatar Jan 20 '22 08:01 geraldus

Any update on this?

MaicolBen avatar May 31 '22 13:05 MaicolBen

I don't think this is actionable with the reports we have so far, as it's not reproduce-able from the info provided.

razzeee avatar Jun 01 '22 06:06 razzeee

FWIW, this is happening to me as well. It only started recently. I can try to provide as many details as possible, if requested. I would not know where to look, as my configuration basically hasn't changed. please and thank you :)

gacallea avatar Oct 02 '22 08:10 gacallea

I would suspect some code to trigger this, but commenting stuff out and trying to find it might be hard depending on your source

razzeee avatar Oct 02 '22 10:10 razzeee

In my case (and others) stopped happening when switching to M1, but it seems that didn't happen for @geraldus.

MaicolBen avatar Oct 03 '22 13:10 MaicolBen

Don't know if this is the exact same issue, but I'm also getting high CPU load when my modules become large (can't define large at the moment) and is related to elm formatter taking an age to run.

@razzeee I'll investigate further when I have the time, and if this is a separate issue let me know and I'll start a new issue when I have more information.

phollyer avatar Nov 15 '22 13:11 phollyer