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

Nimsuggest uses 100% CPU usage with Nim 2.2.0 #24413

Open
xTrayambak opened this issue Nov 7, 2024 · 5 comments
Open

Nimsuggest uses 100% CPU usage with Nim 2.2.0 #24413

xTrayambak opened this issue Nov 7, 2024 · 5 comments

Comments

@xTrayambak
Copy link

Description

Related issues:

Ever since NixOS's package cache started compiling nimlsp (and by extension, nimsuggest) against Nim 2.2.0, I've been noticing abnormally high CPU usage coming from nimsuggest, which often requires me to kill the language server (nimlsp) and restart it.

For now, we're circumventing this by forcing nimlsp to compile against Nim 2.0, but this is more of a bandaid fix than anything (we needed to fix this regression before the NixOS 24.11 merge window closed).

Please let me know if you need to know any other information. I'm using NixOS Unstable (24.11 Vicuna) on an AMD CPU, if that matters.

Nim Version

Nim Compiler Version 2.2.0 [Linux: amd64]
Compiled at 2024-10-02
Copyright (c) 2006-2024 by Andreas Rumpf

active boot switches: -d:release

Current Output

No response

Expected Output

No response

Known Workarounds

Compiling nimlsp (and by extension, nimsuggest) against Nim 2.0

Additional Information

No response

@metagn
Copy link
Collaborator

metagn commented Nov 7, 2024

Does this happen on any specific code? Or on the development branch?

@xTrayambak
Copy link
Author

It occurs in Nim 2.2.0, I haven't tried a development version to see if that works properly. It generally occurs when I open a moderately big file (~700-900 LoC) with various small functions.

@metagn
Copy link
Collaborator

metagn commented Nov 10, 2024

Some specific code where this happens would be appreciated, otherwise we can only guess what the issue is. A project is fine too but a minimal example would make it much easier to figure out the problem.

Also, does the same issue happen with nimlangserver?

@michaelnew
Copy link
Contributor

I'm seeing this too after updating to nim 2.2.0. nimlsp will peg to 100% and I have to kill it. nimlangserver fares better, but it will still frequently spike to 100% and stay there for 5 to 10 seconds. This is with neovim 0.10.2, if that matters.

I don't have a minimal repro yet but I'll try to get something together.

@xTrayambak
Copy link
Author

I'm using Neovim too, if that matters. I'll link this file as it used to trigger this the most for me. It's around 900-ish lines long and uses templates, if that matters.

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

No branches or pull requests

3 participants