Skip to content

High CPU usage and autocompletion breaking on Windows #612

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

Closed
tomwyr opened this issue Sep 27, 2023 · 9 comments
Closed

High CPU usage and autocompletion breaking on Windows #612

tomwyr opened this issue Sep 27, 2023 · 9 comments
Labels
bug Something isn't working sourcekit-lsp SourceKit-LSP issue windows Issue specific to Windows

Comments

@tomwyr
Copy link

tomwyr commented Sep 27, 2023

Describe the bug
Opening a new file and just changing language mode to Swift causes multiple cores of the CPU to kick in and never stop, even when the source file is still empty. Also, the autocompletion doesn't seem to work and, as soon as there's an error introduced to the code, the analyzer hangs at displaying that particular error unless I restart vscode or the LSP.

Expected behavior
Autocompletion doesn't break and CPU usage is low when LSP has nothing to be busy with.

Environment

  • OS: Windows 11
  • Swift version: compnerd.org Swift version 5.9 (swift-5.9-RELEASE) Target: x86_64-unknown-windows-msvc
  • Visual Studio Code version: 1.82.2
  • vscode-swift version: 1.5.2

Additional context
The red lines on the screenshots mark the moment where language mode is changed to Swift and (I assume) the vscode extension gets activated.

1
2
3

@tomwyr tomwyr added the bug Something isn't working label Sep 27, 2023
@adam-fowler
Copy link
Contributor

adam-fowler commented Sep 27, 2023

@compnerd have you seen anything like this?

@Shockah
Copy link

Shockah commented Oct 4, 2023

Having the same issue, straight after setting up Swift and VSCode. Killing the sourcekit-lsp.exe process unfreezes autocompletion, but any further change has the same result.

@natinusala
Copy link

I have the same issue on Windows 10 here.

I also have a weird problem where the SourceKit LSP process locks up C files (including headers) in my project and I can't edit them anymore unless I fully exit vscode (which kills sourcekit). I don't know if it's related.

@adam-fowler
Copy link
Contributor

I also have a weird problem where the SourceKit LSP process locks up C files (including headers) in my project and I can't edit them anymore unless I fully exit vscode (which kills sourcekit). I don't know if it's related.

This will be unrelated. Probably an issue you should post to sourcekit-lsp repo.

@tomwyr Similarly this performance issue should be bugged on sourcekit-lsp repo

@icnahom
Copy link

icnahom commented Oct 27, 2023

The issue does not occur in Swift 5.8.1.

@adam-fowler
Copy link
Contributor

The issue does not occur in Swift 5.8.1.

Can anyone else verify this please?

@tomwyr
Copy link
Author

tomwyr commented Oct 27, 2023

Can confirm the CPU usage is back to normal in Swift 5.8.1. Also I tested the latest version 5.9.1 on a different laptop and the problem persists there as well.

@adam-fowler
Copy link
Contributor

This almost certainly is a SourceKit-LSP issue, so I have reported it there swiftlang/sourcekit-lsp#982

@adam-fowler adam-fowler added the sourcekit-lsp SourceKit-LSP issue label Nov 29, 2023
@adam-fowler
Copy link
Contributor

Closing as related SourceKit-LSP issue has been closed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working sourcekit-lsp SourceKit-LSP issue windows Issue specific to Windows
Projects
None yet
Development

No branches or pull requests

5 participants