microsoft / microsoft/TypeScript
High CPU Usage in Editor (and Controls for LSP)
- Dominant language
- Go
- Stars
- 111k
- Forks
- 14.3k
- Avg merge
- 2d 4h
- Merged PRs (30d)
- 132
Description
> I am working on low-end laptop and this "cpu spikes" are freezing my pc on large codebases :( To fix that for now I wrapped lsp cmd into cpulimit like so: `cpulimit -l 400 -- tsgo --lsp --stdio` and it works, but it would be nice to have some build-in flag for this kind of stuff like we have `--checkers` for the compiler. Especially since GOMAXPROCS=4 didn't work for me and I had to use third-party program (maybe that is because tsgo in my case was installed via npm and actually launched via node?)
_Originally posted by @glav-git in [#4347](https://github.com/microsoft/typescript-go/issues/4347#issuecomment-5185662214)_
Contributor guide
Research direction
The affected entry point is tsgo --lsp --stdio; the issue also mentions --checkers and GOMAXPROCS as comparison points. Start by reproducing CPU spikes on a large codebase with that command, then determine the intended built-in control. Done means users can limit LSP CPU usage without wrapping tsgo in cpulimit.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- go
- Domain
- performance, tooling
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100