Very bad performance when using a Language Server

I am currently developing an Extension which, among other things, adds support for a Language Server: GitHub - ilyakooo0/haskell-nova

The problem I am facing: when enabling the Language Server the performance of the editor becomes awful. The editor sometime dips to something like 1 frame her second rendering.

It is almost as if handling some part of the Language Server is done synchronously, and the Language server itself is slow to respond.

I have record a small clip of what it looks like when editing with the language server enabled: https://youtu.be/Fx36acLtxlU

The project I am using in the clip is: GitHub - typeable/octopod: Kubernetes self-service portal

I can provide more information if you are having trouble reproducing the issue.

Hello, not an expert of Haskell but willing to help. Can you share the minimal project/file you tested which may lead to the bad performance?

And are other features of LSP (like hover) work well?

The features work great.

The plugin currently doesn’t download Haskell-language-server properly. I will post steps to reproduce the issue once I get that sorted.

@cccc

This is not minimal in any way, but this project is easy to get going and reproduces the issue: GitHub - ilyakooo0/grenade: Deep Learning in Haskell

To having the plugin start the Language Server:

  1. Install Stack: The Haskell Tool Stack
  2. stack build in the project directory to download and build dependencies
  3. Open the project with the plugin installedcomma
  4. Run the “Restart Haskell Language Server” command to download and start the language server.

After trying, also observed bad completion performance in my Swift language server extension.

It seems that Nova extension blocks the editing operation when providing completion. If code completion is disabled, the performance will be back to normal.

Update: even code completion is disabled, the problem still exists.

I’d like to look into this, as generally we test with several language servers in our release testing and so far haven’t noticed (or received word from users) about significant slowdowns in any of them (our tests include the TypeScript, Python, and Intelephense LSPs, fwiw).

I’m afraid I am wholy unqualified at Haskell, but I can definitely try and get the Swift extension you linked up and running to see what might be slowing things down.

2 Likes

@logan To reproduce the problem with the Swift extension:

  1. Download and install the Swift extension from the link.
  2. Configure the language server path in the preference of the Swift extension.
  3. Following the instructions, create a new swift package (e.g. MyPackage).
  4. Open the project, and make sure that hover works well (so that the LSP works).
  5. Type func (or something else) into the end of the Sources/MyPackage/MyPackage.swift file, and you will observe the problem.

After investigation, this does not appear to be specifically related to the LSP or the editor, but in fact to the debug messaging being printed to the Extension Console while the extension in debug mode. It’s outputting a huge amount of text that the console can’t quite keep up with. We’ll work on improving this.

3 Likes

How can I disable debug mode?