Skip to content

Track minimum language version for various language features#57670

Merged
rbuckton merged 5 commits intomainfrom
fix41241
Mar 11, 2024
Merged

Track minimum language version for various language features#57670
rbuckton merged 5 commits intomainfrom
fix41241

Conversation

@rbuckton
Copy link
Copy Markdown
Contributor

@rbuckton rbuckton commented Mar 6, 2024

This adds LanguageFeatureMinimumTarget, which is used to track the specific ECMAScript edition that various language features were standardized. This is intended to be a central location to check for when specific features are added to the language and provide a single place to update a feature's minimum target from ESNext to the edition it landed in.

In keeping with this, all of our emit helper checks have been tightened up to reference the correct version for when a given emit helper is not necessary during emit.

Fixes #41241

@rbuckton rbuckton requested review from sandersn and weswigham March 6, 2024 23:09
@typescript-bot typescript-bot added Author: Team For Milestone Bug PRs that fix a bug with a specific milestone labels Mar 6, 2024
Copy link
Copy Markdown
Member

@sandersn sandersn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like this idea, and would love for it to include a way to remember to update lib/esnext.*.d.ts. (Right now I think our intended approach is to manually check each year after the June TC39 meeting.)

Comment thread src/compiler/types.ts Outdated
*
* @internal
*/
export namespace LanguageFeatureMinimumTarget {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we turn this into a const enum such that it gets inlined? I believe we should be able to reference ScriptTarget from one. Or does that fail because of the type mismatch with ScriptTarget?

(Would like to limit our use of namespaces, honestly... plus potential perf hits here)

Copy link
Copy Markdown
Member

@RyanCavanaugh RyanCavanaugh Mar 6, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Or just a big const since we don't really need the reverse lookup (perf hit should be almost none)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It doesn't fail to match ScriptTarget, but it does produce its own type which doesn't illustrate the relationship when looking at the .d.ts file:

image

vs.

image

vs.

image

I actually still like namespace in moderation. This felt like an appropriate use for it, but I don't mind the as const. There's no perf difference between namespace and as const.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is an internal declaration, so I don't personally feel like it's a big deal for the values to be opaque. It does make me wonder if we're missing something in declaration emit that would have reused those nodes, though.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Namespaces, as a concept, exist in both the standard library (Math, Atomics, Reflect) and the web platform (subtle, performance, etc.) so I don't agree that they should be wholly discouraged.

Copy link
Copy Markdown
Member

@jakebailey jakebailey Mar 6, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure, I'm just trying to avoid the runtime cost of them in the code we do control (e.g. const enums are inlined, modules are tree shaken).

Copy link
Copy Markdown
Contributor Author

@rbuckton rbuckton Mar 6, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If the perf results show a significant dip I can make it a const enum. It just feels less useful when hover information only shows the final value like 2 instead of something meaningful like ES2015.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see what you mean; I do wish our hover and declaration emit did better here. But, we seem to just always compute in dts emit (not sure about hover).

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see what you mean; I do wish our hover and declaration emit did better here. But, we seem to just always compute in dts emit (not sure about hover).

It's arguable as to whether someone who writes const enum E2 { A = E1.B } would expect hover/d.ts to print the value or qualified name. With const variables or fields it's far clearer as to what to show. I could see maybe supporting const enum E2 { A = E1.B as E1.B } or something similar to explicitly opt-in to showing the qualified name, but that seems like a very niche use case.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would much rather see (enum member) TypeFlags.Unit = Enum | Literal | UniqueESSymbol | Nullable than (enum member) TypeFlags.Unit = 109472. The actual computed values seem like the least important part of an enum.

@RyanCavanaugh
Copy link
Copy Markdown
Member

This is great

@rbuckton
Copy link
Copy Markdown
Contributor Author

rbuckton commented Mar 6, 2024

I like this idea, and would love for it to include a way to remember to update lib/esnext.*.d.ts. (Right now I think our intended approach is to manually check each year after the June TC39 meeting.)

The best we might be able to do is to just document this, ScriptTarget, and transformESNext with comments. We will still need to watch for the June Meeting regardless.

@rbuckton
Copy link
Copy Markdown
Contributor Author

rbuckton commented Mar 6, 2024

@typescript-bot perf test

@typescript-bot
Copy link
Copy Markdown
Collaborator

typescript-bot commented Mar 6, 2024

Starting jobs; this comment will be updated as builds start and complete.

Command Status Results
perf test ✅ Started 👀 Results

@typescript-bot
Copy link
Copy Markdown
Collaborator

@rbuckton
The results of the perf run you requested are in!

Here they are:

tsc

Comparison Report - baseline..pr
Metric baseline pr Delta Best Worst p-value
Angular - node (v18.15.0, x64)
Memory used 295,569k (± 0.01%) 295,583k (± 0.01%) ~ 295,559k 295,606k p=0.296 n=6
Parse Time 2.66s (± 0.39%) 2.66s (± 0.15%) ~ 2.66s 2.67s p=0.924 n=6
Bind Time 0.83s (± 0.49%) 0.83s (± 0.00%) ~ 0.83s 0.83s p=0.405 n=6
Check Time 8.21s (± 0.40%) 8.24s (± 0.51%) ~ 8.19s 8.30s p=0.377 n=6
Emit Time 7.11s (± 0.47%) 7.10s (± 0.27%) ~ 7.08s 7.13s p=0.628 n=6
Total Time 18.82s (± 0.26%) 18.83s (± 0.23%) ~ 18.76s 18.87s p=0.809 n=6
Compiler-Unions - node (v18.15.0, x64)
Memory used 192,697k (± 0.96%) 192,780k (± 0.90%) ~ 191,490k 195,055k p=0.471 n=6
Parse Time 1.36s (± 0.86%) 1.36s (± 1.43%) ~ 1.33s 1.38s p=1.000 n=6
Bind Time 0.72s (± 0.00%) 0.72s (± 0.00%) ~ 0.72s 0.72s p=1.000 n=6
Check Time 9.38s (± 0.64%) 9.36s (± 0.63%) ~ 9.29s 9.46s p=0.469 n=6
Emit Time 2.61s (± 0.54%) 2.60s (± 0.16%) ~ 2.59s 2.60s p=0.103 n=6
Total Time 14.08s (± 0.46%) 14.04s (± 0.43%) ~ 13.96s 14.13s p=0.375 n=6
Monaco - node (v18.15.0, x64)
Memory used 347,344k (± 0.00%) 347,368k (± 0.01%) ~ 347,334k 347,389k p=0.066 n=6
Parse Time 2.47s (± 0.33%) 2.48s (± 0.57%) ~ 2.46s 2.50s p=0.402 n=6
Bind Time 0.93s (± 0.59%) 0.93s (± 0.44%) ~ 0.92s 0.93s p=0.282 n=6
Check Time 6.94s (± 0.45%) 6.97s (± 0.61%) ~ 6.91s 7.02s p=0.294 n=6
Emit Time 4.07s (± 0.24%) 4.07s (± 0.34%) ~ 4.05s 4.08s p=0.401 n=6
Total Time 14.41s (± 0.18%) 14.44s (± 0.39%) ~ 14.37s 14.50s p=0.466 n=6
TFS - node (v18.15.0, x64)
Memory used 302,778k (± 0.01%) 302,775k (± 0.01%) ~ 302,746k 302,797k p=0.471 n=6
Parse Time 2.01s (± 0.49%) 2.01s (± 0.87%) ~ 1.99s 2.03s p=0.458 n=6
Bind Time 1.00s (± 1.09%) 1.00s (± 1.36%) ~ 0.99s 1.02s p=0.933 n=6
Check Time 6.34s (± 0.50%) 6.36s (± 0.35%) ~ 6.34s 6.39s p=0.167 n=6
Emit Time 3.60s (± 0.38%) 3.59s (± 0.21%) ~ 3.58s 3.60s p=0.099 n=6
Total Time 12.95s (± 0.19%) 12.98s (± 0.22%) ~ 12.94s 13.01s p=0.170 n=6
material-ui - node (v18.15.0, x64)
Memory used 511,213k (± 0.00%) 511,214k (± 0.00%) ~ 511,191k 511,233k p=1.000 n=6
Parse Time 2.65s (± 0.65%) 2.66s (± 0.51%) ~ 2.64s 2.68s p=0.138 n=6
Bind Time 0.98s (± 0.83%) 0.98s (± 0.77%) ~ 0.97s 0.99s p=0.729 n=6
Check Time 17.30s (± 0.51%) 17.26s (± 0.28%) ~ 17.20s 17.32s p=0.378 n=6
Emit Time 0.00s (± 0.00%) 0.00s (± 0.00%) ~ 0.00s 0.00s p=1.000 n=6
Total Time 20.93s (± 0.38%) 20.91s (± 0.24%) ~ 20.83s 20.98s p=0.521 n=6
mui-docs - node (v18.15.0, x64)
Memory used 2,296,327k (± 0.00%) 2,296,295k (± 0.00%) ~ 2,296,222k 2,296,367k p=0.173 n=6
Parse Time 11.99s (± 0.60%) 11.96s (± 0.53%) ~ 11.89s 12.08s p=0.574 n=6
Bind Time 2.65s (± 0.15%) 2.64s (± 0.37%) ~ 2.63s 2.65s p=0.213 n=6
Check Time 101.13s (± 0.98%) 102.47s (± 0.61%) +1.35s (+ 1.33%) 101.75s 103.39s p=0.045 n=6
Emit Time 0.32s (± 0.00%) 0.32s (± 0.00%) ~ 0.32s 0.32s p=1.000 n=6
Total Time 116.08s (± 0.87%) 117.40s (± 0.50%) +1.32s (+ 1.14%) 116.75s 118.31s p=0.045 n=6
self-build-src - node (v18.15.0, x64)
Memory used 2,394,318k (± 0.03%) 2,395,783k (± 0.01%) +1,465k (+ 0.06%) 2,395,322k 2,396,197k p=0.005 n=6
Parse Time 5.09s (± 0.41%) 5.03s (± 0.39%) -0.06s (- 1.11%) 5.01s 5.06s p=0.005 n=6
Bind Time 1.90s (± 0.70%) 1.90s (± 0.79%) ~ 1.87s 1.91s p=0.676 n=6
Check Time 33.69s (± 0.17%) 33.57s (± 0.30%) ~ 33.46s 33.73s p=0.066 n=6
Emit Time 2.70s (± 1.16%) 2.70s (± 1.48%) ~ 2.66s 2.75s p=1.000 n=6
Total Time 43.39s (± 0.16%) 43.21s (± 0.27%) -0.18s (- 0.43%) 43.04s 43.34s p=0.020 n=6
self-compiler - node (v18.15.0, x64)
Memory used 414,425k (± 0.01%) 414,570k (± 0.01%) +145k (+ 0.04%) 414,516k 414,634k p=0.005 n=6
Parse Time 2.82s (± 1.11%) 2.81s (± 0.84%) ~ 2.76s 2.82s p=1.000 n=6
Bind Time 1.07s (± 0.76%) 1.07s (± 0.70%) ~ 1.06s 1.08s p=0.729 n=6
Check Time 15.16s (± 0.18%) 15.17s (± 0.24%) ~ 15.13s 15.23s p=0.519 n=6
Emit Time 1.10s (± 0.81%) 1.14s (± 2.00%) +0.04s (+ 3.64%) 1.12s 1.17s p=0.005 n=6
Total Time 20.14s (± 0.14%) 20.19s (± 0.29%) ~ 20.08s 20.24s p=0.090 n=6
vscode - node (v18.15.0, x64)
Memory used 2,860,076k (± 0.00%) 2,860,176k (± 0.00%) ~ 2,860,117k 2,860,268k p=0.066 n=6
Parse Time 10.74s (± 0.34%) 10.79s (± 0.25%) +0.06s (+ 0.54%) 10.75s 10.83s p=0.035 n=6
Bind Time 3.44s (± 0.29%) 3.44s (± 0.22%) ~ 3.43s 3.45s p=0.554 n=6
Check Time 61.10s (± 0.37%) 61.05s (± 0.44%) ~ 60.68s 61.37s p=0.810 n=6
Emit Time 16.90s (± 8.40%) 16.26s (± 0.65%) ~ 16.12s 16.40s p=0.226 n=6
Total Time 92.18s (± 1.65%) 91.55s (± 0.37%) ~ 90.97s 91.95s p=0.810 n=6
webpack - node (v18.15.0, x64)
Memory used 397,071k (± 0.02%) 397,017k (± 0.02%) ~ 396,925k 397,134k p=0.378 n=6
Parse Time 3.13s (± 0.51%) 3.13s (± 0.87%) ~ 3.09s 3.16s p=0.935 n=6
Bind Time 1.38s (± 2.09%) 1.38s (± 1.70%) ~ 1.34s 1.41s p=0.935 n=6
Check Time 13.99s (± 0.35%) 13.94s (± 0.36%) ~ 13.88s 14.01s p=0.106 n=6
Emit Time 0.00s (± 0.00%) 0.00s (± 0.00%) ~ 0.00s 0.00s p=1.000 n=6
Total Time 18.50s (± 0.22%) 18.44s (± 0.38%) ~ 18.33s 18.54s p=0.108 n=6
xstate - node (v18.15.0, x64)
Memory used 513,107k (± 0.00%) 513,137k (± 0.01%) ~ 513,095k 513,211k p=0.258 n=6
Parse Time 3.28s (± 0.25%) 3.27s (± 0.30%) ~ 3.26s 3.29s p=0.282 n=6
Bind Time 1.54s (± 0.33%) 1.54s (± 0.92%) ~ 1.52s 1.56s p=0.667 n=6
Check Time 2.87s (± 0.78%) 2.85s (± 0.42%) ~ 2.84s 2.87s p=0.198 n=6
Emit Time 0.08s (± 0.00%) 0.08s (± 4.99%) ~ 0.08s 0.09s p=0.405 n=6
Total Time 7.77s (± 0.32%) 7.75s (± 0.19%) ~ 7.72s 7.76s p=0.061 n=6
System info unknown
Hosts
  • node (v18.15.0, x64)
Scenarios
  • Angular - node (v18.15.0, x64)
  • Compiler-Unions - node (v18.15.0, x64)
  • Monaco - node (v18.15.0, x64)
  • TFS - node (v18.15.0, x64)
  • material-ui - node (v18.15.0, x64)
  • mui-docs - node (v18.15.0, x64)
  • self-build-src - node (v18.15.0, x64)
  • self-compiler - node (v18.15.0, x64)
  • vscode - node (v18.15.0, x64)
  • webpack - node (v18.15.0, x64)
  • xstate - node (v18.15.0, x64)
Benchmark Name Iterations
Current pr 6
Baseline baseline 6

tsserver

Comparison Report - baseline..pr
Metric baseline pr Delta Best Worst p-value
Compiler-UnionsTSServer - node (v18.15.0, x64)
Req 1 - updateOpen 2,347ms (± 1.00%) 2,356ms (± 0.60%) ~ 2,342ms 2,375ms p=0.378 n=6
Req 2 - geterr 5,561ms (± 1.43%) 5,544ms (± 1.49%) ~ 5,473ms 5,652ms p=0.936 n=6
Req 3 - references 328ms (± 1.29%) 327ms (± 1.66%) ~ 322ms 335ms p=0.806 n=6
Req 4 - navto 274ms (± 0.79%) 275ms (± 0.85%) ~ 271ms 276ms p=0.276 n=6
Req 5 - completionInfo count 1,357 (± 0.00%) 1,357 (± 0.00%) ~ 1,357 1,357 p=1.000 n=6
Req 5 - completionInfo 86ms (± 8.72%) 84ms (± 8.67%) ~ 79ms 94ms p=0.720 n=6
CompilerTSServer - node (v18.15.0, x64)
Req 1 - updateOpen 2,513ms (± 0.70%) 2,488ms (± 1.11%) ~ 2,445ms 2,520ms p=0.092 n=6
Req 2 - geterr 4,156ms (± 1.37%) 4,237ms (± 1.84%) ~ 4,135ms 4,304ms p=0.054 n=6
Req 3 - references 338ms (± 1.54%) 335ms (± 0.84%) ~ 332ms 340ms p=0.326 n=6
Req 4 - navto 285ms (± 0.38%) 285ms (± 0.43%) ~ 283ms 286ms p=0.487 n=6
Req 5 - completionInfo count 1,519 (± 0.00%) 1,519 (± 0.00%) ~ 1,519 1,519 p=1.000 n=6
Req 5 - completionInfo 87ms (± 5.25%) 83ms (± 7.73%) ~ 77ms 90ms p=0.210 n=6
xstateTSServer - node (v18.15.0, x64)
Req 1 - updateOpen 2,601ms (± 1.06%) 2,604ms (± 0.28%) ~ 2,594ms 2,612ms p=0.810 n=6
Req 2 - geterr 1,732ms (± 2.91%) 1,745ms (± 2.40%) ~ 1,692ms 1,786ms p=0.574 n=6
Req 3 - references 117ms (±10.62%) 112ms (± 9.25%) ~ 104ms 126ms p=0.332 n=6
Req 4 - navto 370ms (± 0.50%) 370ms (± 0.99%) ~ 365ms 376ms p=0.745 n=6
Req 5 - completionInfo count 2,079 (± 0.00%) 2,079 (± 0.00%) ~ 2,079 2,079 p=1.000 n=6
Req 5 - completionInfo 307ms (± 1.93%) 308ms (± 1.35%) ~ 303ms 312ms p=0.572 n=6
System info unknown
Hosts
  • node (v18.15.0, x64)
Scenarios
  • CompilerTSServer - node (v18.15.0, x64)
  • Compiler-UnionsTSServer - node (v18.15.0, x64)
  • xstateTSServer - node (v18.15.0, x64)
Benchmark Name Iterations
Current pr 6
Baseline baseline 6

startup

Comparison Report - baseline..pr
Metric baseline pr Delta Best Worst p-value
tsc-startup - node (v18.15.0, x64)
Execution time 154.13ms (± 0.16%) 154.23ms (± 0.15%) +0.11ms (+ 0.07%) 153.12ms 156.62ms p=0.000 n=600
tsserver-startup - node (v18.15.0, x64)
Execution time 229.40ms (± 0.15%) 229.30ms (± 0.16%) -0.10ms (- 0.04%) 228.07ms 232.90ms p=0.002 n=600
tsserverlibrary-startup - node (v18.15.0, x64)
Execution time 221.58ms (± 0.16%) 221.56ms (± 0.18%) ~ 220.13ms 229.32ms p=0.498 n=600
typescript-startup - node (v18.15.0, x64)
Execution time 221.30ms (± 0.16%) 221.37ms (± 0.18%) ~ 219.73ms 225.52ms p=0.210 n=600
System info unknown
Hosts
  • node (v18.15.0, x64)
Scenarios
  • tsc-startup - node (v18.15.0, x64)
  • tsserver-startup - node (v18.15.0, x64)
  • tsserverlibrary-startup - node (v18.15.0, x64)
  • typescript-startup - node (v18.15.0, x64)
Benchmark Name Iterations
Current pr 6
Baseline baseline 6

Developer Information:

Download Benchmarks

@rbuckton
Copy link
Copy Markdown
Contributor Author

rbuckton commented Mar 7, 2024

@typescript-bot perf test

@typescript-bot
Copy link
Copy Markdown
Collaborator

typescript-bot commented Mar 7, 2024

Starting jobs; this comment will be updated as builds start and complete.

Command Status Results
perf test ✅ Started 👀 Results

@typescript-bot
Copy link
Copy Markdown
Collaborator

@rbuckton
The results of the perf run you requested are in!

Here they are:

tsc

Comparison Report - baseline..pr
Metric baseline pr Delta Best Worst p-value
Angular - node (v18.15.0, x64)
Memory used 295,542k (± 0.01%) 295,541k (± 0.00%) ~ 295,524k 295,556k p=1.000 n=6
Parse Time 2.67s (± 0.21%) 2.67s (± 0.28%) ~ 2.66s 2.68s p=0.476 n=6
Bind Time 0.83s (± 0.66%) 0.83s (± 0.66%) ~ 0.82s 0.83s p=1.000 n=6
Check Time 8.21s (± 0.31%) 8.21s (± 0.27%) ~ 8.17s 8.23s p=0.869 n=6
Emit Time 7.13s (± 0.19%) 7.13s (± 0.40%) ~ 7.10s 7.18s p=1.000 n=6
Total Time 18.83s (± 0.16%) 18.83s (± 0.24%) ~ 18.76s 18.88s p=0.871 n=6
Compiler-Unions - node (v18.15.0, x64)
Memory used 193,268k (± 0.96%) 192,099k (± 0.73%) ~ 191,429k 194,953k p=0.128 n=6
Parse Time 1.35s (± 1.21%) 1.36s (± 0.86%) ~ 1.35s 1.38s p=0.250 n=6
Bind Time 0.72s (± 0.00%) 0.72s (± 0.00%) ~ 0.72s 0.72s p=1.000 n=6
Check Time 9.41s (± 0.65%) 9.38s (± 0.62%) ~ 9.29s 9.46s p=0.375 n=6
Emit Time 2.61s (± 0.48%) 2.61s (± 0.62%) ~ 2.59s 2.63s p=0.737 n=6
Total Time 14.09s (± 0.43%) 14.07s (± 0.39%) ~ 13.99s 14.15s p=0.810 n=6
Monaco - node (v18.15.0, x64)
Memory used 347,309k (± 0.01%) 347,315k (± 0.01%) ~ 347,267k 347,369k p=0.689 n=6
Parse Time 2.47s (± 0.33%) 2.48s (± 0.78%) ~ 2.45s 2.51s p=0.231 n=6
Bind Time 0.93s (± 0.56%) 0.92s (± 0.59%) ~ 0.92s 0.93s p=0.640 n=6
Check Time 6.94s (± 0.60%) 6.96s (± 0.34%) ~ 6.92s 6.99s p=0.571 n=6
Emit Time 4.05s (± 0.34%) 4.07s (± 0.62%) ~ 4.05s 4.12s p=0.054 n=6
Total Time 14.39s (± 0.29%) 14.44s (± 0.28%) ~ 14.39s 14.49s p=0.078 n=6
TFS - node (v18.15.0, x64)
Memory used 302,751k (± 0.01%) 302,747k (± 0.01%) ~ 302,721k 302,771k p=0.936 n=6
Parse Time 2.00s (± 0.93%) 2.01s (± 0.58%) ~ 1.99s 2.02s p=1.000 n=6
Bind Time 1.00s (± 0.75%) 1.00s (± 0.41%) ~ 0.99s 1.00s p=1.000 n=6
Check Time 6.35s (± 0.32%) 6.35s (± 0.30%) ~ 6.32s 6.37s p=0.807 n=6
Emit Time 3.59s (± 0.38%) 3.60s (± 0.23%) ~ 3.59s 3.61s p=0.557 n=6
Total Time 12.95s (± 0.18%) 12.96s (± 0.26%) ~ 12.91s 13.00s p=0.687 n=6
material-ui - node (v18.15.0, x64)
Memory used 511,210k (± 0.00%) 511,261k (± 0.01%) ~ 511,193k 511,382k p=0.261 n=6
Parse Time 2.66s (± 0.74%) 2.65s (± 0.66%) ~ 2.63s 2.67s p=1.000 n=6
Bind Time 0.99s (± 0.76%) 0.98s (± 0.64%) -0.01s (- 1.18%) 0.97s 0.99s p=0.027 n=6
Check Time 17.27s (± 0.22%) 17.25s (± 0.37%) ~ 17.12s 17.29s p=0.517 n=6
Emit Time 0.00s (± 0.00%) 0.00s (± 0.00%) ~ 0.00s 0.00s p=1.000 n=6
Total Time 20.92s (± 0.23%) 20.88s (± 0.39%) ~ 20.72s 20.93s p=0.335 n=6
mui-docs - node (v18.15.0, x64)
Memory used 2,296,287k (± 0.00%) 2,296,334k (± 0.00%) ~ 2,296,310k 2,296,379k p=0.230 n=6
Parse Time 11.92s (± 0.66%) 11.95s (± 1.17%) ~ 11.87s 12.23s p=0.684 n=6
Bind Time 2.64s (± 0.57%) 2.65s (± 0.31%) ~ 2.64s 2.66s p=0.271 n=6
Check Time 101.84s (± 0.96%) 101.38s (± 0.46%) ~ 100.89s 101.96s p=0.689 n=6
Emit Time 0.32s (± 0.00%) 0.32s (± 0.00%) ~ 0.32s 0.32s p=1.000 n=6
Total Time 116.71s (± 0.87%) 116.30s (± 0.44%) ~ 115.74s 116.85s p=0.689 n=6
self-build-src - node (v18.15.0, x64)
Memory used 2,394,202k (± 0.02%) 2,394,715k (± 0.03%) ~ 2,393,773k 2,395,289k p=0.173 n=6
Parse Time 5.06s (± 0.89%) 5.05s (± 1.23%) ~ 4.98s 5.14s p=0.630 n=6
Bind Time 1.90s (± 0.58%) 1.89s (± 0.99%) ~ 1.87s 1.91s p=0.206 n=6
Check Time 33.71s (± 0.55%) 33.54s (± 0.26%) -0.17s (- 0.50%) 33.43s 33.67s p=0.045 n=6
Emit Time 2.68s (± 1.11%) 2.67s (± 0.39%) ~ 2.66s 2.68s p=0.872 n=6
Total Time 43.37s (± 0.42%) 43.15s (± 0.24%) -0.22s (- 0.50%) 42.99s 43.27s p=0.031 n=6
self-compiler - node (v18.15.0, x64)
Memory used 414,492k (± 0.01%) 414,583k (± 0.00%) +91k (+ 0.02%) 414,564k 414,599k p=0.006 n=6
Parse Time 2.81s (± 0.52%) 2.81s (± 0.27%) ~ 2.80s 2.82s p=0.620 n=6
Bind Time 1.07s (± 0.70%) 1.07s (± 0.51%) ~ 1.06s 1.07s p=0.476 n=6
Check Time 15.20s (± 0.47%) 15.18s (± 0.36%) ~ 15.11s 15.25s p=0.809 n=6
Emit Time 1.11s (± 2.88%) 1.11s (± 1.14%) ~ 1.10s 1.13s p=1.000 n=6
Total Time 20.19s (± 0.48%) 20.18s (± 0.36%) ~ 20.08s 20.26s p=0.936 n=6
vscode - node (v18.15.0, x64)
Memory used 2,860,248k (± 0.00%) 2,860,150k (± 0.00%) ~ 2,859,899k 2,860,280k p=0.230 n=6
Parse Time 10.74s (± 0.23%) 10.75s (± 0.28%) ~ 10.71s 10.80s p=0.744 n=6
Bind Time 3.44s (± 0.51%) 3.45s (± 0.53%) ~ 3.43s 3.47s p=0.743 n=6
Check Time 60.85s (± 0.39%) 60.85s (± 0.45%) ~ 60.56s 61.31s p=1.000 n=6
Emit Time 16.26s (± 0.27%) 16.75s (± 6.69%) ~ 16.21s 19.04s p=0.261 n=6
Total Time 91.30s (± 0.26%) 91.80s (± 1.45%) ~ 90.98s 94.50s p=0.810 n=6
webpack - node (v18.15.0, x64)
Memory used 397,033k (± 0.01%) 397,067k (± 0.02%) ~ 396,998k 397,165k p=0.689 n=6
Parse Time 3.13s (± 0.62%) 3.13s (± 0.88%) ~ 3.10s 3.18s p=1.000 n=6
Bind Time 1.37s (± 1.63%) 1.38s (± 1.33%) ~ 1.35s 1.40s p=0.366 n=6
Check Time 13.96s (± 0.36%) 14.03s (± 0.42%) ~ 13.94s 14.12s p=0.061 n=6
Emit Time 0.00s (± 0.00%) 0.00s (± 0.00%) ~ 0.00s 0.00s p=1.000 n=6
Total Time 18.46s (± 0.39%) 18.54s (± 0.35%) ~ 18.45s 18.65s p=0.108 n=6
xstate - node (v18.15.0, x64)
Memory used 513,204k (± 0.01%) 513,137k (± 0.01%) ~ 513,085k 513,211k p=0.066 n=6
Parse Time 3.28s (± 0.23%) 3.28s (± 0.31%) ~ 3.27s 3.30s p=0.931 n=6
Bind Time 1.54s (± 0.41%) 1.54s (± 0.33%) ~ 1.54s 1.55s p=0.386 n=6
Check Time 2.85s (± 0.52%) 2.86s (± 0.69%) ~ 2.85s 2.89s p=0.301 n=6
Emit Time 0.08s (± 0.00%) 0.08s (± 0.00%) ~ 0.08s 0.08s p=1.000 n=6
Total Time 7.75s (± 0.21%) 7.77s (± 0.40%) ~ 7.74s 7.82s p=0.520 n=6
System info unknown
Hosts
  • node (v18.15.0, x64)
Scenarios
  • Angular - node (v18.15.0, x64)
  • Compiler-Unions - node (v18.15.0, x64)
  • Monaco - node (v18.15.0, x64)
  • TFS - node (v18.15.0, x64)
  • material-ui - node (v18.15.0, x64)
  • mui-docs - node (v18.15.0, x64)
  • self-build-src - node (v18.15.0, x64)
  • self-compiler - node (v18.15.0, x64)
  • vscode - node (v18.15.0, x64)
  • webpack - node (v18.15.0, x64)
  • xstate - node (v18.15.0, x64)
Benchmark Name Iterations
Current pr 6
Baseline baseline 6

tsserver

Comparison Report - baseline..pr
Metric baseline pr Delta Best Worst p-value
Compiler-UnionsTSServer - node (v18.15.0, x64)
Req 1 - updateOpen 2,364ms (± 1.03%) 2,347ms (± 1.29%) ~ 2,319ms 2,388ms p=0.298 n=6
Req 2 - geterr 5,514ms (± 1.07%) 5,583ms (± 1.49%) ~ 5,487ms 5,664ms p=0.093 n=6
Req 3 - references 331ms (± 1.16%) 324ms (± 0.51%) -7ms (- 2.17%) 321ms 325ms p=0.029 n=6
Req 4 - navto 276ms (± 0.68%) 276ms (± 1.35%) ~ 271ms 279ms p=0.808 n=6
Req 5 - completionInfo count 1,357 (± 0.00%) 1,357 (± 0.00%) ~ 1,357 1,357 p=1.000 n=6
Req 5 - completionInfo 82ms (± 6.45%) 87ms (± 7.69%) ~ 79ms 93ms p=0.227 n=6
CompilerTSServer - node (v18.15.0, x64)
Req 1 - updateOpen 2,501ms (± 0.70%) 2,510ms (± 1.13%) ~ 2,477ms 2,550ms p=0.521 n=6
Req 2 - geterr 4,143ms (± 0.20%) 4,218ms (± 1.69%) ~ 4,112ms 4,280ms p=0.173 n=6
Req 3 - references 334ms (± 0.29%) 336ms (± 1.20%) ~ 332ms 342ms p=0.869 n=6
Req 4 - navto 286ms (± 0.29%) 285ms (± 0.36%) ~ 283ms 286ms p=0.121 n=6
Req 5 - completionInfo count 1,519 (± 0.00%) 1,519 (± 0.00%) ~ 1,519 1,519 p=1.000 n=6
Req 5 - completionInfo 89ms (± 0.58%) 84ms (± 6.80%) 🟩-6ms (- 6.53%) 78ms 89ms p=0.021 n=6
xstateTSServer - node (v18.15.0, x64)
Req 1 - updateOpen 2,611ms (± 0.37%) 2,610ms (± 0.38%) ~ 2,595ms 2,622ms p=1.000 n=6
Req 2 - geterr 1,757ms (± 2.85%) 1,719ms (± 2.89%) ~ 1,655ms 1,788ms p=0.335 n=6
Req 3 - references 110ms (± 8.18%) 117ms (± 8.33%) ~ 107ms 127ms p=0.126 n=6
Req 4 - navto 372ms (± 1.57%) 370ms (± 1.24%) ~ 361ms 374ms p=0.373 n=6
Req 5 - completionInfo count 2,079 (± 0.00%) 2,079 (± 0.00%) ~ 2,079 2,079 p=1.000 n=6
Req 5 - completionInfo 305ms (± 1.60%) 304ms (± 0.97%) ~ 300ms 307ms p=0.808 n=6
System info unknown
Hosts
  • node (v18.15.0, x64)
Scenarios
  • CompilerTSServer - node (v18.15.0, x64)
  • Compiler-UnionsTSServer - node (v18.15.0, x64)
  • xstateTSServer - node (v18.15.0, x64)
Benchmark Name Iterations
Current pr 6
Baseline baseline 6

startup

Comparison Report - baseline..pr
Metric baseline pr Delta Best Worst p-value
tsc-startup - node (v18.15.0, x64)
Execution time 154.20ms (± 0.19%) 154.13ms (± 0.17%) ~ 153.05ms 157.33ms p=0.058 n=600
tsserver-startup - node (v18.15.0, x64)
Execution time 229.20ms (± 0.20%) 229.05ms (± 0.15%) -0.15ms (- 0.07%) 227.78ms 235.10ms p=0.001 n=600
tsserverlibrary-startup - node (v18.15.0, x64)
Execution time 221.58ms (± 0.16%) 221.50ms (± 0.14%) -0.08ms (- 0.04%) 220.13ms 225.18ms p=0.038 n=600
typescript-startup - node (v18.15.0, x64)
Execution time 221.26ms (± 0.16%) 221.05ms (± 0.15%) -0.21ms (- 0.09%) 219.74ms 224.59ms p=0.000 n=600
System info unknown
Hosts
  • node (v18.15.0, x64)
Scenarios
  • tsc-startup - node (v18.15.0, x64)
  • tsserver-startup - node (v18.15.0, x64)
  • tsserverlibrary-startup - node (v18.15.0, x64)
  • typescript-startup - node (v18.15.0, x64)
Benchmark Name Iterations
Current pr 6
Baseline baseline 6

Developer Information:

Download Benchmarks

@rbuckton
Copy link
Copy Markdown
Contributor Author

rbuckton commented Mar 7, 2024

It looks like the enum version is slightly faster so I'll go with that. We might want to look into quick info/.d.ts emit changes for enums in a future PR.

@rbuckton rbuckton merged commit 193d3cc into main Mar 11, 2024
@rbuckton rbuckton deleted the fix41241 branch March 11, 2024 21:13
@microsoft microsoft locked as resolved and limited conversation to collaborators Oct 16, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Author: Team For Milestone Bug PRs that fix a bug with a specific milestone

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Reevaluate checkExternalEmitHelpers() callers

5 participants