microsoft / microsoft/TypeScript

High CPU Usage in Editor (and Controls for LSP)

未关闭
#63,876 3 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

Needs More Info
主要语言
Go
星标
111k
派生
14.3k
平均合并
2 天 4 小时
30 天内合并 PR
132

描述

> 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)_

贡献指南

打开贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

调研方向

受影响的入口点是 tsgo --lsp --stdio;该 issue 还提到 --checkers 和 GOMAXPROCS,作为比较点。先使用该命令在大型代码库上重现 CPU 峰值,然后确定预期的内置控制方式。当用户无需使用 cpulimit 包装 tsgo 就能限制 LSP 的 CPU 使用率时,即可视为完成。

由索引模型根据 Issue 内容生成。

评估

技术栈
go
领域
performance, tooling
Issue 类型
功能
难度
4/5
预计耗时
3-5 天
活跃度
冷清
描述清晰度
基本清楚
新手友好度
45/100

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。