Skip to content
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

v2.0.0 maxes out my CPU #645

Open
Veradictus opened this issue Apr 13, 2024 · 5 comments
Open

v2.0.0 maxes out my CPU #645

Veradictus opened this issue Apr 13, 2024 · 5 comments
Labels

Comments

@Veradictus
Copy link

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 Veradictus added the bug label Apr 13, 2024
@DaelonSuzuka
Copy link
Collaborator

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?

@donottellmetonottellyou
Copy link

donottellmetonottellyou commented Sep 12, 2024

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

@DaelonSuzuka
Copy link
Collaborator

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?

@donottellmetonottellyou

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.

@Veradictus
Copy link
Author

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants