godot-vscode-plugin icon indicating copy to clipboard operation
godot-vscode-plugin copied to clipboard

v2.0.0 maxes out my CPU

Open Veradictus opened this issue 10 months ago • 5 comments

Godot version

4.2.2-rc2

VS Code version

1.88.1

Godot Tools VS Code extension version

2.0.0

System information

Windows 11

Issue description

Hard to explain why exactly, but after coding for a while, the extension causes 100% CPU usage on my desktop PC. Has happened on other devices as well. As soon as I disable the extension the CPU usage drops to normal amounts.

The plugin must be connected to Godot for this to occur. If the plugin disconnects (after Godot has closed), the CPU usage will persist until all 10 connection trials have completed. Reconnecting afterwards does not yield anymore whacky CPU usage.

Again, I wish I could give more info on this, but I am still trying to diagnose it.

image

Steps to reproduce

I wish I could give more info, all I did was code for an hour or so, and eventually my computer became extremely slow and I began trying to find the issue.

Veradictus avatar Apr 13 '24 01:04 Veradictus

Oh that's weird. Thanks for the report.

I've definitely seen some weird behavior related to the LSP connection, and rewriting that entire module has been on my list for a while.

Maybe you could try cloning the repo and launching the extension in development/debug mode?

DaelonSuzuka avatar Apr 13 '24 16:04 DaelonSuzuka

On Linux, this is being caused by ripgrep. It was working fine for a while, but I all of a sudden got 100% CPU usage. Disabling the extension fixes things.

image

In addition, the extension fails to open the godot editor or connect to the LSP anymore! Confirmed for 2.1.0

donottellmetonottellyou avatar Sep 12 '24 17:09 donottellmetonottellyou

On Linux, this is being caused by ripgrep. It was working fine for a while, but I all of a sudden got 100% CPU usage. Disabling the extension fixes things.

This extension doesn't intentionally invoke ripgrep, so this must be a change inside VSCode itself.

In addition, the extension fails to open the godot editor or connect to the LSP anymore!

That's a bit too vague of a description to properly diagnose, but it sounds like your Godot binary moved. Did you upgrade to 4.3?

DaelonSuzuka avatar Sep 12 '24 17:09 DaelonSuzuka

This extension doesn't intentionally invoke ripgrep, so this must be a change inside VSCode itself.

Possibly, although this didn't coincide with a VSCode update AFAIK. Regardless, something is causing ripgrep to be called when the extension is enabled.

That's a bit too vague of a description to properly diagnose, but it sounds like your Godot binary moved. Did you upgrade to 4.3?

No, still on 4.2.2. I am still able to run Godot from the terminal as well. Even if it did upgrade, I am pointing to the exposed godot4 executable in my path, so that shouldn't change.

The dev environment I am using is here. I am using NixOS linux 24.05 with direnv. If you need any further information or for me to open a separate issue, please let me know.

It appears the LSP works if I launch Godot separately, it just fails to connect more because with the extension enabled all processes are slowed. However, the extension does appear to fail to launch Godot when I click the launch button.

Moreover, it appears that VSCode is not satisfied with launching one ripgrep process; it continues to launch them until the system can't handle it anymore.

donottellmetonottellyou avatar Sep 12 '24 22:09 donottellmetonottellyou

I do not have any additional information this issue as of yet, but what I've noticed is that it tends to happen at random. I haven't had any issues in the past days, but I have also kept the amount of .gd files I'm editing simultaneously at a minimum. Perhaps it has to do with how many files are opened in Godot?

Veradictus avatar Sep 16 '24 17:09 Veradictus