microsoft / microsoft/TypeScript

Regression performance compiling types in version 5.4.2

未关闭
#57,710 20 条评论 2 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

Needs More Info
主要语言
Go
星标
111k
派生
14.4k
平均合并
1 天 19 小时
30 天内合并 PR
117

描述

🔎 Search Terms

"regression", "5.4.2", "performance"

🕗 Version & Regression Information
  • This changed between versions 5.3.3 and 5.4.2
⏯ Playground Link

No response

💻 Code

Extended diagnostics in version 5.4.2

Files:                          4294
Lines of Library:              40640
Lines of Definitions:         180807
Lines of TypeScript:          430513
Lines of JavaScript:               0
Lines of JSON:                     0
Lines of Other:                    0
Identifiers:                  591567
Symbols:                     1232510
Types:                       4677381
Instantiations:            395496734
Memory used:                2330550K
Assignability cache size:    3974893
Identity cache size:           14482
Subtype cache size:            37794
Strict subtype cache size:      9374
I/O Read time:                 0.70s
Parse time:                    0.96s
ResolveModule time:            0.58s
ResolveTypeReference time:     0.01s
ResolveLibrary time:           0.01s
Program time:                  2.51s
Bind time:                     0.62s
Check time:                  367.45s
printTime time:                0.00s
Emit time:                     0.00s
Total time:                  370.58s

Extended diagnostics in version 5.3.3

Files:                         4290
Lines of Library:             40241
Lines of Definitions:        180807
Lines of TypeScript:         430513
Lines of JavaScript:              0
Lines of JSON:                    0
Lines of Other:                   0
Identifiers:                 591320
Symbols:                    1234773
Types:                       699200
Instantiations:             2247099
Memory used:               1308962K
Assignability cache size:    223823
Identity cache size:          14479
Subtype cache size:           28353
Strict subtype cache size:     9128
I/O Read time:                0.73s
Parse time:                   1.11s
ResolveModule time:           0.44s
ResolveTypeReference time:    0.01s
ResolveLibrary time:          0.02s
Program time:                 2.60s
Bind time:                    0.76s
Check time:                  13.75s
printTime time:               0.00s
Emit time:                    0.00s
Total time:                  17.11s
🙁 Actual behavior

The type validation using tsc --noEmit increase more than 20 times using the version 5.4.2 comparing with the version 5.3.3.

In the CI is always hitting the heap memory limit:
image

🙂 Expected behavior

I expected the compilation to be equivalent in both versions, but it was more than 20 times slower.

Additional information about the issue

No response

贡献指南

打开贡献指南

从这里开始

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

调研方向

首先,在生成这些诊断信息的项目上,使用 TypeScript 5.3.3 和 5.4.2 重现报告中的 tsc --noEmit 比较。比较扩展诊断信息,并隔离检查时间、内存和实例化次数增加的原因;完成的标准是通过有针对性的复现或回归测试确认存在回归,并验证修复有效。

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

评估

技术栈
typescript
领域
compilers, performance
Issue 类型
缺陷
难度
4/5
预计耗时
3-5 天
活跃度
停滞
描述清晰度
需要澄清
新手友好度
35/100

把新 issue 发到你的邮箱

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