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

Typescript server is slow on Zed when compared to VSCode #18698

Open
1 task done
baptisteArno opened this issue Oct 3, 2024 · 7 comments
Open
1 task done

Typescript server is slow on Zed when compared to VSCode #18698

baptisteArno opened this issue Oct 3, 2024 · 7 comments
Labels
bug [core label] language server An umbrella label for all language servers large projects For anything relating to large volumes of files or multiple subprojects in one main project. performance Feedback for performance issues, speed, memory usage, etc typescript TypeScript programming language support

Comments

@baptisteArno
Copy link

baptisteArno commented Oct 3, 2024

Check for existing issues

  • Completed

Describe the bug / provide steps to reproduce it

The coding experience in a large Typescript monorepo (https://github.com/baptisteArno/typebot.io) is still an issue for me even though it now uses the vtsls, I still don't get the same speed as VSCode or even NeoVim (with vtsls lsp)

I'm just helpless, what is doing Zed that could cause this code error refresh so slow?

This also can be linked with:

Environment

Zed: v0.156.0 (Zed Preview)
OS: macOS 15.0.0
Memory: 16 GiB
Architecture: aarch64

If applicable, add mockups / screenshots to help explain present your vision of the feature

VSCode:

CleanShot.2024-10-03.at.17.02.42.mp4

Zed:

CleanShot.2024-10-03.at.17.04.27.mp4

If applicable, attach your Zed.log file to this issue.

No response

@baptisteArno baptisteArno added admin read Pending admin review bug [core label] triage Maintainer needs to classify the issue labels Oct 3, 2024
@osiewicz
Copy link
Contributor

osiewicz commented Oct 3, 2024

Could you also record a comparison with Neovim + VTSLS? VSC uses tsserver directly.

@baptisteArno
Copy link
Author

CleanShot.2024-10-03.at.19.57.36.mp4

LazyVim distro with that lsp config override:

return {
  "neovim/nvim-lspconfig",
  opts = function(_, opts)
    opts.inlay_hints.enabled = false
    opts.servers.vtsls.settings.typescript.tsserver = {
      experimental = {
        enableProjectDiagnostics = false,
      },
    }

    opts.servers.vtsls.autoUseWorkspaceTsdk = true

    return opts
  end,
}

@baptisteArno
Copy link
Author

baptisteArno commented Oct 3, 2024

But as you can see in Zed, I'm hovering my mouse over the sessionState variable and it gives me the proper type so I guess that the LSP is up to date but Zed decides not to update the diagnostic overlay directly?

@notpeter notpeter added performance Feedback for performance issues, speed, memory usage, etc typescript TypeScript programming language support language server An umbrella label for all language servers large projects For anything relating to large volumes of files or multiple subprojects in one main project. and removed triage Maintainer needs to classify the issue admin read Pending admin review labels Oct 13, 2024
@juanpmarin
Copy link

juanpmarin commented Oct 24, 2024

Same issue here, I'm running zed on fedora linux

@github-actions github-actions bot added admin read Pending admin review triage Maintainer needs to classify the issue labels Nov 5, 2024
@notpeter notpeter removed triage Maintainer needs to classify the issue admin read Pending admin review labels Nov 5, 2024
@chungweileong94
Copy link
Contributor

Been facing the same issue for the past few months. The only workaround right now is to restart the LSPs once in a while.

@chungweileong94
Copy link
Contributor

chungweileong94 commented Nov 7, 2024

I found this PR from vtsls. It seems Electron came with an unofficial Node version that came with pointer compression, which is also what VSCode is using. I played with it for a while. It does seem like the memory is relatively smaller, but I haven't really started coding with it.

Screen.Recording.2024-11-07.at.9.49.32.PM.mov

[UPDATE] After trying to open files from at least 10 different sub-repos, I can see the tsserver memory usage cut nearly half, from 3GB~ down to 1GB~.

@chungweileong94
Copy link
Contributor

I'm not sure if this is good enough to reproduce the problem, but if you have a really large monorepo, try opening multiple files from multiple different sub-repos, and you will start noticing that the node memory usage will start to build up, which I think tsserver will likely get slow and unusable like the issue described.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug [core label] language server An umbrella label for all language servers large projects For anything relating to large volumes of files or multiple subprojects in one main project. performance Feedback for performance issues, speed, memory usage, etc typescript TypeScript programming language support
Projects
None yet
Development

No branches or pull requests

5 participants