microsoft / microsoft/TypeScript
Cache `getExePath()` for performance reasons
未关闭
还没有人认领这个 Issue。
Possible Improvement
- 主要语言
- Go
- 星标
- 111k
- 派生
- 14.3k
- 平均合并
- 2 天 4 小时
- 30 天内合并 PR
- 132
描述
Would it be possible to have `getExePath()` cache its result so we don't have to do all this lookup every time `tsgo` is invoked? The platform and arch rarely changes once installed on disk.
In one of the repositories I'm maintaining, we've inlined what `tsgo.js` does and added caching on top of it. We're not a very big monorepo, but this shaved off several seconds for us.
贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
调研方向
从 tsgo.js 开始,定位 getExePath() 并跟踪调用 tsgo 时它运行的次数。检查现有查找行为在不同平台和架构上的表现,然后确认缓存能够保留所选的可执行文件,同时避免重复查找。完成的标准是:重复调用不再重新执行查找,且现有行为保持不变。
由索引模型根据 Issue 内容生成。
评估
- 技术栈
- javascript
- 领域
- cli, performance, tooling
- Issue 类型
- 重构
- 难度
- 3/5
- 预计耗时
- 1-2 天
- 活跃度
- 冷清
- 描述清晰度
- 基本清楚
- 新手友好度
- 55/100