Conversation

rbuckton

We have a number of places in our codebase where we optionally attach properties to a Node. While a common practice in JS, this can sometimes have negative consequences with regards to runtime performance. Most modern JavaScript engines use Inline Caches (ICs) to optimize code paths, primarily when reading or writing to properties on objects, or to global variables.

Ideally, we want property ICs to be "monomorphic", such that they only ever see a single object shape (or "map" in V8 parlance) as "monomorphic" property ICs provide the fastest lookups. A "polymorphic" IC has slightly worse performance since it shifts from a one-to-one lookup to a short list of "map"-> property entries. If a new "map" is encountered once a polymorphic IC has around four entries, V8 will shift to a "megamporphic" IC. "Megamorphic" property ICs are the worst in terms of performance, as V8 essentially gives up on fast property access and relies on slow property lookups (there is still a cache, but it is cyclical: repeated property lookups for the same "map" will be fast but will age out as new "maps" are encountered).

Monomorphism isn't always possible, especially when accessing properties like .kind. However, in cases where we have branched on .kind, we should endeavor to ensure that further property accesses within that branch remain monomorphic, or at least polymorphic.

One way to achieve this is to ensure the shape of every Node is stable relative to its kind. This has the following implications:

  • Properties of Node and its subtypes really shouldn't be "optional" and should be fully initialized when a Node is produced (even if only with undefined).
  • Avoid casting nodes to things they aren't (there were several cases of node as any as JSDocContainer and node as TypeNode & { <optional properties> }).
  • Move properties off of supertypes that belong on subtypes (such as symbol, localSymbol, locals, nextContainer, flowNode, etc.), as that results in unchecked node.symbol accesses which often result in "wrong map" deoptimizations.
  • Avoid using "cover types" with a lot of optional properties in favor of union types where you must discriminate before access.
  • Avoid accessing properties other than kind when the node is a supertype or union, unless the function is only accessing one or two properties (like pos/end) since a megamorphic lookup on "pos" will have the same cost as a megamorpic lookup on "kind".
  • Where possible, a function or code path should try to target a single Node subtype, especially if it accesses multiple properties.

There is a trade-off for these changes, however. Pre-defining potentially unused properties on a Node increases the memory footprint. As such, if the memory cost becomes too severe, we may want to investigate removing properties from some Node subtypes where the value can be trivially recomputed from source or moved into a cache like NodeLinks or EmitNode.

@typescript-bottypescript-bot added Author: Team For Uncommitted BugPR for untriaged, rejected, closed or missing buglabels Nov 29, 2022
@microsoftmicrosoft deleted a comment from typescript-bot Nov 29, 2022
@microsoftmicrosoft deleted a comment from typescript-bot Nov 29, 2022
@rbuckton

@typescript-bot perf test

@typescript-bot

Heya @rbuckton, I've started to run the perf test suite on this PR at 70cdafc. You can monitor the build here.

Update: The results are in!

@typescript-bot

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

Here they are:

Compiler

Comparison Report - main..51682
Metricmain51682DeltaBestWorst
Angular - node (v18.10.0, x64)
Memory used341,231k (± 0.02%)364,522k (± 0.02%)+23,291k (+ 6.83%)364,330k364,631k
Parse Time1.56s (± 0.92%)1.56s (± 0.63%)-0.00s (- 0.06%)1.54s1.58s
Bind Time0.53s (± 0.89%)0.56s (± 1.20%)+0.02s (+ 4.50%)0.54s0.57s
Check Time4.01s (± 1.11%)3.95s (± 0.82%)-0.07s (- 1.64%)3.89s4.03s
Emit Time4.29s (± 0.99%)3.93s (± 1.47%)🟩-0.36s (- 8.37%)3.84s4.13s
Total Time10.39s (± 0.53%)9.99s (± 0.77%)🟩-0.40s (- 3.87%)9.89s10.27s
Compiler-Unions - node (v18.10.0, x64)
Memory used187,342k (± 1.08%)197,373k (± 0.65%)+10,031k (+ 5.35%)196,734k202,523k
Parse Time0.62s (± 0.99%)0.61s (± 1.19%)-0.01s (- 1.45%)0.60s0.63s
Bind Time0.33s (± 1.34%)0.35s (± 2.49%)+0.02s (+ 4.82%)0.34s0.37s
Check Time5.05s (± 0.86%)4.93s (± 0.78%)-0.12s (- 2.34%)4.88s5.04s
Emit Time1.56s (± 0.63%)1.46s (± 0.70%)🟩-0.10s (- 6.59%)1.44s1.49s
Total Time7.57s (± 0.54%)7.35s (± 0.60%)-0.21s (- 2.84%)7.28s7.48s
Monaco - node (v18.10.0, x64)
Memory used320,497k (± 0.01%)347,249k (± 0.01%)+26,752k (+ 8.35%)347,114k347,334k
Parse Time1.16s (± 1.79%)1.18s (± 0.81%)+0.01s (+ 1.03%)1.16s1.19s
Bind Time0.49s (± 1.40%)0.50s (± 0.80%)+0.01s (+ 3.09%)0.49s0.51s
Check Time3.85s (± 0.49%)3.69s (± 0.25%)🟩-0.16s (- 4.10%)3.67s3.71s
Emit Time2.26s (± 1.00%)2.04s (± 1.21%)🟩-0.22s (- 9.62%)2.00s2.11s
Total Time7.76s (± 0.50%)7.41s (± 0.35%)🟩-0.35s (- 4.49%)7.34s7.46s
TFS - node (v18.10.0, x64)
Memory used283,711k (± 0.25%)306,302k (± 0.23%)+22,591k (+ 7.96%)304,838k307,007k
Parse Time0.97s (± 2.04%)0.97s (± 1.55%)-0.00s (- 0.31%)0.94s1.00s
Bind Time0.45s (± 6.89%)0.52s (± 8.55%)+0.07s (+15.66%)0.45s0.59s
Check Time3.79s (± 0.65%)3.62s (± 0.59%)🟩-0.17s (- 4.41%)3.57s3.67s
Emit Time2.22s (± 0.88%)2.02s (± 0.37%)🟩-0.19s (- 8.75%)2.01s2.04s
Total Time7.42s (± 0.82%)7.13s (± 0.81%)🟩-0.29s (- 3.96%)6.99s7.24s
material-ui - node (v18.10.0, x64)
Memory used435,953k (± 0.02%)451,491k (± 0.01%)+15,538k (+ 3.56%)451,398k451,623k
Parse Time1.33s (± 0.74%)1.32s (± 0.36%)-0.01s (- 0.68%)1.31s1.33s
Bind Time0.49s (± 1.00%)0.44s (± 1.02%)🟩-0.06s (-11.34%)0.43s0.45s
Check Time10.36s (± 0.90%)10.22s (± 0.80%)-0.15s (- 1.42%)10.10s10.46s
Emit Time0.00s (± 0.00%)0.00s (± 0.00%)0.00s ( NaN%)0.00s0.00s
Total Time12.19s (± 0.85%)11.98s (± 0.68%)-0.21s (- 1.74%)11.85s12.22s
xstate - node (v18.10.0, x64)
Memory used518,397k (± 0.01%)553,113k (± 0.01%)+34,716k (+ 6.70%)552,966k553,340k
Parse Time1.91s (± 0.61%)1.92s (± 0.52%)+0.01s (+ 0.63%)1.90s1.94s
Bind Time0.77s (± 3.38%)0.75s (± 2.99%)-0.02s (- 2.46%)0.69s0.79s
Check Time1.04s (± 0.73%)1.02s (± 0.85%)-0.02s (- 1.74%)1.00s1.04s
Emit Time0.05s (± 0.00%)0.05s (± 0.00%)0.00s ( 0.00%)0.05s0.05s
Total Time3.77s (± 1.00%)3.74s (± 0.71%)-0.03s (- 0.85%)3.66s3.79s
Angular - node (v16.17.1, x64)
Memory used340,608k (± 0.02%)363,911k (± 0.02%)+23,303k (+ 6.84%)363,727k364,005k
Parse Time1.90s (± 0.36%)1.91s (± 0.58%)+0.02s (+ 1.06%)1.90s1.95s
Bind Time0.65s (± 0.72%)0.67s (± 0.77%)+0.02s (+ 3.23%)0.66s0.68s
Check Time5.18s (± 0.39%)5.02s (± 0.80%)🟩-0.16s (- 3.05%)4.93s5.10s
Emit Time5.14s (± 0.67%)4.71s (± 1.81%)🟩-0.43s (- 8.32%)4.57s5.01s
Total Time12.87s (± 0.39%)12.32s (± 0.77%)🟩-0.54s (- 4.23%)12.10s12.53s
Compiler-Unions - node (v16.17.1, x64)
Memory used187,354k (± 0.53%)200,511k (± 0.60%)+13,156k (+ 7.02%)198,477k201,977k
Parse Time0.79s (± 1.03%)0.79s (± 0.38%)-0.00s (- 0.13%)0.79s0.80s
Bind Time0.42s (± 1.12%)0.44s (± 0.91%)+0.02s (+ 3.78%)0.43s0.45s
Check Time6.09s (± 0.48%)5.89s (± 1.05%)🟩-0.20s (- 3.25%)5.80s6.11s
Emit Time1.93s (± 0.49%)1.80s (± 1.21%)🟩-0.12s (- 6.33%)1.78s1.88s
Total Time9.23s (± 0.40%)8.93s (± 0.73%)🟩-0.31s (- 3.32%)8.80s9.14s
Monaco - node (v16.17.1, x64)
Memory used319,816k (± 0.01%)346,546k (± 0.02%)+26,730k (+ 8.36%)346,386k346,654k
Parse Time1.43s (± 0.47%)1.43s (± 0.47%)-0.01s (- 0.42%)1.41s1.44s
Bind Time0.60s (± 0.61%)0.61s (± 0.85%)+0.02s (+ 2.52%)0.60s0.62s
Check Time4.89s (± 0.35%)4.69s (± 0.48%)🟩-0.20s (- 3.99%)4.65s4.74s
Emit Time2.74s (± 0.74%)2.49s (± 0.81%)🟩-0.26s (- 9.30%)2.42s2.53s
Total Time9.66s (± 0.32%)9.22s (± 0.47%)🟩-0.43s (- 4.50%)9.13s9.34s
TFS - node (v16.17.1, x64)
Memory used282,283k (± 0.01%)304,161k (± 0.01%)+21,879k (+ 7.75%)304,117k304,192k
Parse Time1.17s (± 0.71%)1.16s (± 0.57%)-0.00s (- 0.26%)1.15s1.18s
Bind Time0.66s (± 3.82%)0.59s (± 4.04%)🟩-0.07s (-10.41%)0.58s0.69s
Check Time4.77s (± 0.38%)4.59s (± 0.41%)🟩-0.18s (- 3.84%)4.53s4.62s
Emit Time2.79s (± 1.88%)2.52s (± 1.61%)🟩-0.27s (- 9.58%)2.47s2.62s
Total Time9.39s (± 0.78%)8.87s (± 0.53%)🟩-0.52s (- 5.55%)8.81s9.00s
material-ui - node (v16.17.1, x64)
Memory used435,264k (± 0.00%)450,960k (± 0.01%)+15,696k (+ 3.61%)450,867k451,070k
Parse Time1.65s (± 0.75%)1.67s (± 0.75%)+0.01s (+ 0.85%)1.64s1.69s
Bind Time0.50s (± 1.15%)0.51s (± 1.14%)+0.00s (+ 0.80%)0.50s0.52s
Check Time11.87s (± 0.66%)11.78s (± 0.78%)-0.09s (- 0.76%)11.61s11.93s
Emit Time0.00s (± 0.00%)0.00s (± 0.00%)0.00s ( NaN%)0.00s0.00s
Total Time14.02s (± 0.61%)13.95s (± 0.67%)-0.07s (- 0.49%)13.77s14.13s
xstate - node (v16.17.1, x64)
Memory used515,991k (± 0.01%)550,680k (± 0.01%)+34,690k (+ 6.72%)550,577k550,859k
Parse Time2.32s (± 0.59%)2.33s (± 0.81%)+0.02s (+ 0.65%)2.28s2.37s
Bind Time0.84s (± 1.28%)0.84s (± 2.65%)-0.00s (- 0.36%)0.80s0.90s
Check Time1.36s (± 0.77%)1.33s (± 0.65%)-0.03s (- 1.91%)1.31s1.35s
Emit Time0.06s (± 0.00%)0.06s (± 0.00%)0.00s ( 0.00%)0.06s0.06s
Total Time4.58s (± 0.54%)4.57s (± 0.51%)-0.01s (- 0.24%)4.51s4.64s
Angular - node (v14.15.1, x64)
Memory used334,102k (± 0.01%)357,633k (± 0.01%)+23,531k (+ 7.04%)357,587k357,708k
Parse Time2.07s (± 0.75%)2.04s (± 0.64%)-0.03s (- 1.35%)2.02s2.08s
Bind Time0.70s (± 0.84%)0.72s (± 0.56%)+0.01s (+ 2.13%)0.71s0.73s
Check Time5.54s (± 0.71%)5.35s (± 0.31%)🟩-0.20s (- 3.57%)5.31s5.38s
Emit Time5.38s (± 0.72%)4.80s (± 0.80%)🟩-0.57s (-10.67%)4.73s4.88s
Total Time13.70s (± 0.50%)12.91s (± 0.40%)🟩-0.79s (- 5.73%)12.79s13.05s
Compiler-Unions - node (v14.15.1, x64)
Memory used182,679k (± 0.63%)196,207k (± 0.52%)+13,528k (+ 7.41%)193,420k196,950k
Parse Time0.89s (± 0.82%)0.90s (± 0.66%)+0.01s (+ 0.90%)0.88s0.91s
Bind Time0.46s (± 1.09%)0.47s (± 0.85%)+0.02s (+ 3.52%)0.46s0.48s
Check Time6.36s (± 0.55%)6.10s (± 0.53%)🟩-0.26s (- 4.05%)6.03s6.17s
Emit Time2.07s (± 1.36%)1.91s (± 0.49%)🟩-0.16s (- 7.87%)1.88s1.93s
Total Time9.77s (± 0.50%)9.38s (± 0.33%)🟩-0.40s (- 4.08%)9.31s9.45s
Monaco - node (v14.15.1, x64)
Memory used314,635k (± 0.01%)341,509k (± 0.00%)+26,874k (+ 8.54%)341,472k341,544k
Parse Time1.58s (± 0.60%)1.58s (± 0.67%)-0.00s (- 0.06%)1.56s1.61s
Bind Time0.64s (± 0.58%)0.64s (± 0.56%)+0.01s (+ 1.42%)0.64s0.65s
Check Time5.19s (± 0.49%)4.98s (± 0.56%)🟩-0.21s (- 4.06%)4.94s5.04s
Emit Time2.91s (± 0.83%)2.57s (± 0.87%)🟩-0.34s (-11.62%)2.53s2.62s
Total Time10.32s (± 0.37%)9.78s (± 0.48%)🟩-0.54s (- 5.25%)9.71s9.89s
TFS - node (v14.15.1, x64)
Memory used279,369k (± 0.01%)301,278k (± 0.00%)+21,909k (+ 7.84%)301,251k301,312k
Parse Time1.33s (± 1.19%)1.33s (± 1.49%)+0.00s (+ 0.30%)1.31s1.40s
Bind Time0.59s (± 0.68%)0.61s (± 1.96%)+0.02s (+ 4.07%)0.60s0.66s
Check Time5.07s (± 0.65%)4.86s (± 0.34%)🟩-0.21s (- 4.09%)4.83s4.91s
Emit Time3.08s (± 0.78%)2.78s (± 1.27%)🟩-0.30s (- 9.61%)2.73s2.87s
Total Time10.07s (± 0.59%)9.59s (± 0.44%)🟩-0.48s (- 4.78%)9.49s9.67s
material-ui - node (v14.15.1, x64)
Memory used430,750k (± 0.00%)446,409k (± 0.01%)+15,658k (+ 3.64%)446,328k446,454k
Parse Time1.87s (± 0.67%)1.87s (± 0.36%)+0.00s (+ 0.11%)1.86s1.89s
Bind Time0.53s (± 1.40%)0.55s (± 0.85%)+0.02s (+ 3.19%)0.54s0.56s
Check Time12.29s (± 0.73%)12.17s (± 0.75%)-0.13s (- 1.04%)11.98s12.32s
Emit Time0.00s (± 0.00%)0.00s (± 0.00%)0.00s ( NaN%)0.00s0.00s
Total Time14.70s (± 0.63%)14.59s (± 0.64%)-0.11s (- 0.75%)14.40s14.77s
xstate - node (v14.15.1, x64)
Memory used504,228k (± 0.00%)539,071k (± 0.00%)+34,844k (+ 6.91%)539,033k539,141k
Parse Time2.63s (± 0.50%)2.65s (± 0.64%)+0.02s (+ 0.65%)2.62s2.70s
Bind Time0.84s (± 0.62%)0.83s (± 0.60%)-0.01s (- 0.71%)0.82s0.84s
Check Time1.48s (± 0.61%)1.47s (± 0.61%)-0.01s (- 0.61%)1.44s1.48s
Emit Time0.07s (± 0.00%)0.07s (± 0.00%)0.00s ( 0.00%)0.07s0.07s
Total Time5.02s (± 0.34%)5.02s (± 0.45%)-0.00s (- 0.04%)4.96s5.08s
System
Machine Namets-ci-ubuntu
Platformlinux 5.4.0-131-generic
Architecturex64
Available Memory16 GB
Available Memory15 GB
CPUs4 × Intel(R) Core(TM) i7-4770 CPU @ 3.40GHz
Hosts
  • node (v18.10.0, x64)
  • node (v16.17.1, x64)
  • node (v14.15.1, x64)
Scenarios
  • Angular - node (v18.10.0, x64)
  • Angular - node (v16.17.1, x64)
  • Angular - node (v14.15.1, x64)
  • Compiler-Unions - node (v18.10.0, x64)
  • Compiler-Unions - node (v16.17.1, x64)
  • Compiler-Unions - node (v14.15.1, x64)
  • Monaco - node (v18.10.0, x64)
  • Monaco - node (v16.17.1, x64)
  • Monaco - node (v14.15.1, x64)
  • TFS - node (v18.10.0, x64)
  • TFS - node (v16.17.1, x64)
  • TFS - node (v14.15.1, x64)
  • material-ui - node (v18.10.0, x64)
  • material-ui - node (v16.17.1, x64)
  • material-ui - node (v14.15.1, x64)
  • xstate - node (v18.10.0, x64)
  • xstate - node (v16.17.1, x64)
  • xstate - node (v14.15.1, x64)
BenchmarkNameIterations
Current5168210
Baselinemain10

TSServer

Comparison Report - main..51682
Metricmain51682DeltaBestWorst
Compiler-UnionsTSServer - node (v18.10.0, x64)
Req 1 - updateOpen1,057ms (± 1.02%)1,058ms (± 0.87%)+1ms (+ 0.09%)1,040ms1,079ms
Req 2 - geterr2,592ms (± 1.16%)2,533ms (± 0.92%)-59ms (- 2.29%)2,482ms2,574ms
Req 3 - references166ms (± 0.57%)164ms (± 0.73%)-1ms (- 0.78%)161ms167ms
Req 4 - navto140ms (± 1.75%)143ms (± 1.70%)+4ms (+ 2.51%)139ms151ms
Req 5 - completionInfo count1,356 (± 0.00%)1,356 (± 0.00%)0 ( 0.00%)1,3561,356
Req 5 - completionInfo62ms (± 2.20%)53ms (± 7.31%)🟩-8ms (-13.59%)48ms62ms
CompilerTSServer - node (v18.10.0, x64)
Req 1 - updateOpen1,106ms (± 0.79%)1,138ms (± 0.47%)+32ms (+ 2.87%)1,129ms1,156ms
Req 2 - geterr1,596ms (± 0.64%)1,571ms (± 0.62%)-25ms (- 1.57%)1,553ms1,591ms
Req 3 - references170ms (± 0.84%)172ms (± 0.91%)+3ms (+ 1.59%)170ms177ms
Req 4 - navto151ms (± 0.59%)153ms (± 1.04%)+2ms (+ 1.06%)150ms156ms
Req 5 - completionInfo count1,518 (± 0.00%)1,518 (± 0.00%)0 ( 0.00%)1,5181,518
Req 5 - completionInfo54ms (± 1.89%)54ms (± 1.41%)+0ms (+ 0.19%)52ms56ms
xstateTSServer - node (v18.10.0, x64)
Req 1 - updateOpen1,513ms (± 0.62%)1,566ms (± 1.10%)+53ms (+ 3.51%)1,536ms1,620ms
Req 2 - geterr555ms (± 1.14%)535ms (± 0.83%)🟩-21ms (- 3.69%)523ms540ms
Req 3 - references58ms (± 1.16%)57ms (± 2.44%)-1ms (- 2.08%)54ms60ms
Req 4 - navto197ms (± 0.66%)193ms (± 0.66%)-3ms (- 1.73%)191ms195ms
Req 5 - completionInfo count3,154 (± 0.00%)3,154 (± 0.00%)0 ( 0.00%)3,1543,154
Req 5 - completionInfo212ms (± 0.80%)215ms (± 1.65%)+2ms (+ 1.04%)205ms222ms
Compiler-UnionsTSServer - node (v16.17.1, x64)
Req 1 - updateOpen1,310ms (± 0.53%)1,329ms (± 0.55%)+19ms (+ 1.41%)1,312ms1,346ms
Req 2 - geterr3,195ms (± 0.71%)3,161ms (± 0.99%)-34ms (- 1.06%)3,077ms3,244ms
Req 3 - references192ms (± 0.83%)195ms (± 1.57%)+3ms (+ 1.77%)189ms204ms
Req 4 - navto152ms (± 0.98%)155ms (± 0.97%)+3ms (+ 1.64%)151ms157ms
Req 5 - completionInfo count1,356 (± 0.00%)1,356 (± 0.00%)0 ( 0.00%)1,3561,356
Req 5 - completionInfo63ms (± 5.11%)58ms (± 1.53%)🟩-5ms (- 7.30%)57ms60ms
CompilerTSServer - node (v16.17.1, x64)
Req 1 - updateOpen1,393ms (± 0.74%)1,421ms (± 0.67%)+28ms (+ 2.00%)1,399ms1,438ms
Req 2 - geterr2,109ms (± 0.48%)2,058ms (± 0.59%)-51ms (- 2.42%)2,033ms2,079ms
Req 3 - references200ms (± 0.45%)202ms (± 0.64%)+2ms (+ 0.95%)198ms203ms
Req 4 - navto167ms (± 1.45%)168ms (± 1.17%)+1ms (+ 0.60%)165ms173ms
Req 5 - completionInfo count1,518 (± 0.00%)1,518 (± 0.00%)0 ( 0.00%)1,5181,518
Req 5 - completionInfo56ms (± 0.71%)57ms (± 1.32%)+1ms (+ 1.07%)55ms58ms
xstateTSServer - node (v16.17.1, x64)
Req 1 - updateOpen1,834ms (± 0.36%)1,877ms (± 0.72%)+43ms (+ 2.33%)1,840ms1,904ms
Req 2 - geterr725ms (± 0.49%)699ms (± 0.30%)🟩-26ms (- 3.61%)694ms704ms
Req 3 - references68ms (± 0.77%)68ms (± 1.77%)-0ms (- 0.29%)65ms70ms
Req 4 - navto200ms (± 0.58%)196ms (± 0.95%)-4ms (- 1.80%)191ms200ms
Req 5 - completionInfo count3,154 (± 0.00%)3,154 (± 0.00%)0 ( 0.00%)3,1543,154
Req 5 - completionInfo254ms (± 0.69%)258ms (± 1.28%)+4ms (+ 1.49%)252ms266ms
Compiler-UnionsTSServer - node (v14.15.1, x64)
Req 1 - updateOpen1,461ms (± 0.52%)1,471ms (± 0.82%)+10ms (+ 0.65%)1,451ms1,501ms
Req 2 - geterr3,447ms (± 0.78%)3,355ms (± 0.54%)-92ms (- 2.66%)3,314ms3,397ms
Req 3 - references206ms (± 0.18%)210ms (± 0.85%)+4ms (+ 1.74%)207ms214ms
Req 4 - navto163ms (± 0.38%)170ms (± 0.98%)+7ms (+ 4.17%)166ms174ms
Req 5 - completionInfo count1,356 (± 0.00%)1,356 (± 0.00%)0 ( 0.00%)1,3561,356
Req 5 - completionInfo58ms (± 1.29%)59ms (± 1.61%)+1ms (+ 1.73%)57ms62ms
CompilerTSServer - node (v14.15.1, x64)
Req 1 - updateOpen1,537ms (± 0.45%)1,572ms (± 0.24%)+35ms (+ 2.29%)1,562ms1,580ms
Req 2 - geterr2,287ms (± 0.47%)2,205ms (± 0.36%)🟩-82ms (- 3.57%)2,187ms2,227ms
Req 3 - references217ms (± 0.84%)219ms (± 0.92%)+2ms (+ 0.97%)215ms224ms
Req 4 - navto175ms (± 0.99%)179ms (± 0.72%)+4ms (+ 2.52%)176ms181ms
Req 5 - completionInfo count1,518 (± 0.00%)1,518 (± 0.00%)0 ( 0.00%)1,5181,518
Req 5 - completionInfo56ms (± 1.47%)60ms (± 2.45%)+4ms (+ 6.21%)57ms63ms
xstateTSServer - node (v14.15.1, x64)
Req 1 - updateOpen2,018ms (± 0.86%)1,987ms (± 0.49%)-31ms (- 1.53%)1,973ms2,019ms
Req 2 - geterr750ms (± 0.63%)737ms (± 0.65%)-13ms (- 1.76%)730ms750ms
Req 3 - references73ms (± 1.23%)73ms (± 1.15%)+1ms (+ 0.69%)72ms76ms
Req 4 - navto219ms (± 0.64%)212ms (± 0.94%)🟩-7ms (- 3.33%)208ms218ms
Req 5 - completionInfo count3,154 (± 0.00%)3,154 (± 0.00%)0 ( 0.00%)3,1543,154
Req 5 - completionInfo273ms (± 1.66%)281ms (± 1.46%)+7ms (+ 2.71%)272ms288ms
System
Machine Namets-ci-ubuntu
Platformlinux 5.4.0-131-generic
Architecturex64
Available Memory16 GB
Available Memory15 GB
CPUs4 × Intel(R) Core(TM) i7-4770 CPU @ 3.40GHz
Hosts
  • node (v18.10.0, x64)
  • node (v16.17.1, x64)
  • node (v14.15.1, x64)
Scenarios
  • Compiler-UnionsTSServer - node (v18.10.0, x64)
  • Compiler-UnionsTSServer - node (v16.17.1, x64)
  • Compiler-UnionsTSServer - node (v14.15.1, x64)
  • CompilerTSServer - node (v18.10.0, x64)
  • CompilerTSServer - node (v16.17.1, x64)
  • CompilerTSServer - node (v14.15.1, x64)
  • xstateTSServer - node (v18.10.0, x64)
  • xstateTSServer - node (v16.17.1, x64)
  • xstateTSServer - node (v14.15.1, x64)
BenchmarkNameIterations
Current5168210
Baselinemain10

Startup

Comparison Report - main..51682
Metricmain51682DeltaBestWorst
tsc-startup - node (v16.17.1, x64)
Execution time120.48ms (± 0.61%)117.75ms (± 0.43%)-2.73ms (- 2.26%)115.38ms129.08ms
tsserver-startup - node (v16.17.1, x64)
Execution time201.08ms (± 0.48%)199.17ms (± 0.40%)-1.91ms (- 0.95%)195.18ms210.37ms
tsserverlibrary-startup - node (v16.17.1, x64)
Execution time195.97ms (± 0.39%)193.30ms (± 0.43%)-2.67ms (- 1.36%)189.50ms201.28ms
typescript-startup - node (v16.17.1, x64)
Execution time179.65ms (± 0.45%)179.68ms (± 0.44%)+0.02ms (+ 0.01%)174.98ms185.97ms
System
Machine Namets-ci-ubuntu
Platformlinux 5.4.0-131-generic
Architecturex64
Available Memory16 GB
Available Memory15 GB
CPUs4 × Intel(R) Core(TM) i7-4770 CPU @ 3.40GHz
Hosts
  • node (v16.17.1, x64)
Scenarios
  • tsc-startup - node (v16.17.1, x64)
  • tsserver-startup - node (v16.17.1, x64)
  • tsserverlibrary-startup - node (v16.17.1, x64)
  • typescript-startup - node (v16.17.1, x64)
BenchmarkNameIterations
Current5168210
Baselinemain10

Developer Information:

Download Benchmark

@@ -84,3 +84,4 @@ tests/cases/user/puppeteer/puppeteer
tests/cases/user/axios-src/axios-src
tests/cases/user/prettier/prettier
.eslintcache
*v8.log
Copy link
Contributor

Choose a reason for hiding this comment

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

a question, if I may, what kind of tools you were using to investigate those things? I imagine that in the case of Nodes the issue was already known for some time but I wonder how I could test those things in my libraries.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I have an internal tool I wrote to analyze log files generated by various V8 commandline options.

Copy link
Contributor

Choose a reason for hiding this comment

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

@Andarist One open source tool that might be of interest is https://.com/thlorenz/deoptigate

Choose a reason for hiding this comment

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

Looks good to me*, just a few detail questions.

*Looking at the functionality changes -- I'll take your word that the performance is better.

@rbuckton

@typescript-bot perf test

Running again after rebasing against main in case something changed.

@typescript-bot

Heya @rbuckton, I've started to run the perf test suite on this PR at f476065. You can monitor the build here.

Update: The results are in!

@typescript-bot

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

Here they are:

Compiler

Comparison Report - main..51682
Metricmain51682DeltaBestWorst
Angular - node (v18.10.0, x64)
Memory used341,094k (± 0.01%)364,492k (± 0.02%)+23,398k (+ 6.86%)364,274k364,558k
Parse Time1.55s (± 0.91%)1.56s (± 0.58%)+0.01s (+ 0.32%)1.54s1.58s
Bind Time0.52s (± 1.06%)0.54s (± 0.88%)+0.02s (+ 4.02%)0.53s0.55s
Check Time3.99s (± 0.51%)3.90s (± 0.51%)-0.09s (- 2.25%)3.87s3.95s
Emit Time4.26s (± 1.07%)3.90s (± 0.46%)🟩-0.36s (- 8.44%)3.87s3.96s
Total Time10.34s (± 0.48%)9.91s (± 0.23%)🟩-0.43s (- 4.14%)9.85s9.95s
Compiler-Unions - node (v18.10.0, x64)
Memory used187,849k (± 1.10%)199,082k (± 1.06%)+11,233k (+ 5.98%)196,633k202,606k
Parse Time0.61s (± 1.23%)0.61s (± 0.95%)-0.00s (- 0.16%)0.60s0.62s
Bind Time0.33s (± 1.14%)0.35s (± 1.49%)+0.02s (+ 7.38%)0.34s0.36s
Check Time5.02s (± 0.53%)4.93s (± 0.70%)-0.09s (- 1.87%)4.86s5.02s
Emit Time1.55s (± 0.91%)1.46s (± 1.27%)🟩-0.10s (- 6.24%)1.42s1.51s
Total Time7.52s (± 0.35%)7.35s (± 0.64%)-0.17s (- 2.25%)7.26s7.45s
Monaco - node (v18.10.0, x64)
Memory used320,437k (± 0.02%)347,167k (± 0.02%)+26,730k (+ 8.34%)347,003k347,306k
Parse Time1.14s (± 0.96%)1.17s (± 0.77%)+0.03s (+ 2.37%)1.15s1.18s
Bind Time0.48s (± 1.09%)0.51s (± 1.74%)+0.03s (+ 5.85%)0.49s0.53s
Check Time3.84s (± 0.50%)3.70s (± 0.47%)🟩-0.14s (- 3.68%)3.66s3.75s
Emit Time2.24s (± 0.69%)2.05s (± 0.88%)🟩-0.19s (- 8.31%)2.00s2.08s
Total Time7.69s (± 0.23%)7.42s (± 0.35%)🟩-0.27s (- 3.56%)7.33s7.46s
TFS - node (v18.10.0, x64)
Memory used283,508k (± 0.24%)305,468k (± 0.23%)+21,960k (+ 7.75%)304,697k306,941k
Parse Time0.95s (± 0.50%)0.94s (± 1.17%)-0.01s (- 0.74%)0.93s0.98s
Bind Time0.47s (± 8.80%)0.56s (± 5.11%)+0.09s (+20.30%)0.45s0.59s
Check Time3.79s (± 0.99%)3.62s (± 0.32%)🟩-0.17s (- 4.38%)3.60s3.65s
Emit Time2.20s (± 1.04%)2.01s (± 0.68%)🟩-0.19s (- 8.46%)1.99s2.05s
Total Time7.40s (± 0.63%)7.14s (± 0.31%)🟩-0.26s (- 3.57%)7.08s7.17s
material-ui - node (v18.10.0, x64)
Memory used435,974k (± 0.01%)451,646k (± 0.01%)+15,672k (+ 3.59%)451,548k451,853k
Parse Time1.31s (± 0.76%)1.34s (± 1.15%)+0.03s (+ 2.13%)1.32s1.37s
Bind Time0.49s (± 0.68%)0.42s (± 1.77%)🟩-0.07s (-14.29%)0.41s0.44s
Check Time10.26s (± 0.87%)10.14s (± 0.45%)-0.12s (- 1.13%)10.08s10.27s
Emit Time0.00s (± 0.00%)0.00s (± 0.00%)0.00s ( NaN%)0.00s0.00s
Total Time12.06s (± 0.74%)11.90s (± 0.34%)-0.16s (- 1.30%)11.86s12.02s
xstate - node (v18.10.0, x64)
Memory used518,650k (± 0.01%)553,440k (± 0.01%)+34,791k (+ 6.71%)553,358k553,593k
Parse Time1.88s (± 0.64%)1.88s (± 0.36%)+0.01s (+ 0.37%)1.87s1.90s
Bind Time0.70s (± 2.08%)0.72s (± 2.79%)+0.02s (+ 2.73%)0.67s0.76s
Check Time1.04s (± 0.55%)1.02s (± 1.00%)-0.02s (- 1.83%)1.00s1.05s
Emit Time0.05s (± 0.00%)0.05s (± 0.00%)0.00s ( 0.00%)0.05s0.05s
Total Time3.67s (± 0.53%)3.68s (± 0.53%)+0.01s (+ 0.30%)3.65s3.73s
Angular - node (v16.17.1, x64)
Memory used340,507k (± 0.02%)363,820k (± 0.01%)+23,312k (+ 6.85%)363,672k363,860k
Parse Time1.86s (± 0.38%)1.90s (± 0.72%)+0.04s (+ 2.31%)1.88s1.94s
Bind Time0.65s (± 0.56%)0.67s (± 1.14%)+0.02s (+ 3.10%)0.66s0.69s
Check Time5.14s (± 0.59%)5.02s (± 0.47%)-0.12s (- 2.32%)4.97s5.08s
Emit Time5.08s (± 0.60%)4.69s (± 0.82%)🟩-0.39s (- 7.66%)4.61s4.77s
Total Time12.72s (± 0.41%)12.28s (± 0.52%)🟩-0.45s (- 3.53%)12.15s12.40s
Compiler-Unions - node (v16.17.1, x64)
Memory used188,325k (± 0.65%)199,862k (± 0.61%)+11,537k (+ 6.13%)198,494k202,021k
Parse Time0.78s (± 0.74%)0.79s (± 0.84%)+0.01s (+ 0.89%)0.78s0.80s
Bind Time0.42s (± 0.82%)0.44s (± 1.09%)+0.02s (+ 4.80%)0.43s0.45s
Check Time6.05s (± 0.48%)5.91s (± 0.82%)-0.14s (- 2.28%)5.82s6.02s
Emit Time1.93s (± 0.75%)1.80s (± 0.54%)🟩-0.13s (- 6.69%)1.78s1.82s
Total Time9.18s (± 0.40%)8.94s (± 0.69%)-0.24s (- 2.65%)8.83s9.09s
Monaco - node (v16.17.1, x64)
Memory used319,791k (± 0.01%)346,535k (± 0.01%)+26,744k (+ 8.36%)346,460k346,579k
Parse Time1.40s (± 0.53%)1.42s (± 0.58%)+0.02s (+ 1.43%)1.40s1.44s
Bind Time0.59s (± 0.75%)0.61s (± 0.78%)+0.02s (+ 2.53%)0.60s0.62s
Check Time4.84s (± 0.43%)4.66s (± 0.65%)🟩-0.18s (- 3.64%)4.60s4.74s
Emit Time2.71s (± 0.65%)2.47s (± 0.84%)🟩-0.24s (- 8.75%)2.43s2.51s
Total Time9.54s (± 0.36%)9.16s (± 0.37%)🟩-0.38s (- 3.97%)9.07s9.23s
TFS - node (v16.17.1, x64)
Memory used282,300k (± 0.01%)304,182k (± 0.01%)+21,882k (+ 7.75%)304,138k304,212k
Parse Time1.15s (± 0.83%)1.18s (± 1.12%)+0.04s (+ 3.23%)1.15s1.21s
Bind Time0.65s (± 4.83%)0.58s (± 1.29%)🟩-0.07s (-10.68%)0.56s0.59s
Check Time4.77s (± 0.44%)4.58s (± 0.29%)🟩-0.19s (- 4.08%)4.56s4.61s
Emit Time2.79s (± 2.02%)2.52s (± 2.02%)🟩-0.27s (- 9.57%)2.43s2.62s
Total Time9.35s (± 0.74%)8.86s (± 0.59%)🟩-0.49s (- 5.28%)8.77s8.95s
material-ui - node (v16.17.1, x64)
Memory used435,348k (± 0.01%)451,036k (± 0.02%)+15,688k (+ 3.60%)450,909k451,232k
Parse Time1.62s (± 0.42%)1.64s (± 0.34%)+0.03s (+ 1.61%)1.63s1.65s
Bind Time0.50s (± 0.72%)0.49s (± 0.68%)-0.01s (- 2.78%)0.48s0.50s
Check Time11.79s (± 1.16%)11.64s (± 0.66%)-0.15s (- 1.25%)11.49s11.85s
Emit Time0.00s (± 0.00%)0.00s (± 0.00%)0.00s ( NaN%)0.00s0.00s
Total Time13.91s (± 0.98%)13.77s (± 0.55%)-0.14s (- 0.97%)13.61s13.97s
xstate - node (v16.17.1, x64)
Memory used516,237k (± 0.01%)550,972k (± 0.01%)+34,736k (+ 6.73%)550,838k551,161k
Parse Time2.26s (± 0.59%)2.27s (± 0.63%)+0.01s (+ 0.40%)2.23s2.29s
Bind Time0.82s (± 1.18%)0.81s (± 1.56%)-0.01s (- 1.22%)0.78s0.84s
Check Time1.34s (± 0.54%)1.33s (± 0.71%)-0.01s (- 0.60%)1.32s1.35s
Emit Time0.06s (± 0.00%)0.06s (± 0.00%)0.00s ( 0.00%)0.06s0.06s
Total Time4.48s (± 0.22%)4.47s (± 0.38%)-0.01s (- 0.18%)4.43s4.50s
Angular - node (v14.15.1, x64)
Memory used333,996k (± 0.01%)357,677k (± 0.00%)+23,680k (+ 7.09%)357,649k357,719k
Parse Time2.04s (± 0.64%)2.03s (± 0.66%)-0.00s (- 0.10%)2.01s2.07s
Bind Time0.70s (± 0.52%)0.71s (± 0.67%)+0.01s (+ 1.58%)0.70s0.72s
Check Time5.47s (± 0.43%)5.34s (± 0.22%)-0.13s (- 2.36%)5.32s5.37s
Emit Time5.32s (± 0.72%)4.78s (± 0.42%)🟩-0.54s (-10.21%)4.74s4.84s
Total Time13.52s (± 0.36%)12.86s (± 0.26%)🟩-0.66s (- 4.87%)12.82s12.97s
Compiler-Unions - node (v14.15.1, x64)
Memory used183,047k (± 0.68%)196,508k (± 0.38%)+13,461k (+ 7.35%)193,530k196,873k
Parse Time0.89s (± 0.67%)0.90s (± 0.75%)+0.01s (+ 1.24%)0.88s0.91s
Bind Time0.46s (± 1.32%)0.47s (± 0.78%)+0.01s (+ 2.42%)0.46s0.47s
Check Time6.36s (± 0.45%)6.12s (± 0.27%)🟩-0.24s (- 3.74%)6.08s6.16s
Emit Time2.06s (± 0.82%)1.89s (± 0.71%)🟩-0.17s (- 8.39%)1.86s1.92s
Total Time9.76s (± 0.32%)9.37s (± 0.30%)🟩-0.39s (- 4.02%)9.30s9.45s
Monaco - node (v14.15.1, x64)
Memory used314,576k (± 0.01%)341,514k (± 0.01%)+26,938k (+ 8.56%)341,477k341,550k
Parse Time1.56s (± 0.72%)1.57s (± 0.45%)+0.01s (+ 0.90%)1.56s1.59s
Bind Time0.63s (± 0.75%)0.65s (± 0.77%)+0.02s (+ 2.38%)0.64s0.66s
Check Time5.20s (± 0.44%)4.98s (± 0.52%)🟩-0.22s (- 4.29%)4.92s5.04s
Emit Time2.88s (± 0.34%)2.59s (± 1.12%)🟩-0.29s (-10.20%)2.54s2.67s
Total Time10.26s (± 0.29%)9.78s (± 0.50%)🟩-0.49s (- 4.76%)9.69s9.94s
TFS - node (v14.15.1, x64)
Memory used279,383k (± 0.01%)301,308k (± 0.01%)+21,925k (+ 7.85%)301,250k301,352k
Parse Time1.31s (± 0.55%)1.31s (± 0.51%)-0.00s (- 0.38%)1.30s1.33s
Bind Time0.59s (± 0.62%)0.60s (± 0.56%)+0.02s (+ 2.90%)0.60s0.61s
Check Time5.08s (± 0.60%)4.88s (± 0.29%)🟩-0.21s (- 4.05%)4.85s4.90s
Emit Time3.08s (± 0.59%)2.78s (± 0.59%)🟩-0.30s (- 9.62%)2.75s2.82s
Total Time10.06s (± 0.43%)9.57s (± 0.17%)🟩-0.49s (- 4.90%)9.53s9.60s
material-ui - node (v14.15.1, x64)
Memory used430,799k (± 0.01%)446,659k (± 0.03%)+15,860k (+ 3.68%)446,345k446,793k
Parse Time1.85s (± 0.43%)1.87s (± 0.62%)+0.01s (+ 0.76%)1.85s1.90s
Bind Time0.53s (± 0.42%)0.54s (± 0.89%)+0.01s (+ 1.13%)0.53s0.55s
Check Time12.24s (± 0.53%)12.02s (± 0.63%)-0.22s (- 1.81%)11.89s12.23s
Emit Time0.00s (± 0.00%)0.00s (± 0.00%)0.00s ( NaN%)0.00s0.00s
Total Time14.62s (± 0.46%)14.42s (± 0.55%)-0.20s (- 1.40%)14.28s14.63s
xstate - node (v14.15.1, x64)
Memory used504,618k (± 0.01%)539,565k (± 0.01%)+34,947k (+ 6.93%)539,519k539,660k
Parse Time2.54s (± 0.40%)2.58s (± 0.68%)+0.04s (+ 1.42%)2.55s2.61s
Bind Time0.83s (± 0.44%)0.81s (± 0.64%)🟩-0.03s (- 3.11%)0.80s0.82s
Check Time1.47s (± 0.35%)1.45s (± 0.48%)-0.02s (- 1.23%)1.44s1.47s
Emit Time0.07s (± 0.00%)0.07s (± 3.23%)-0.00s (- 1.43%)0.06s0.07s
Total Time4.92s (± 0.26%)4.92s (± 0.39%)-0.00s (- 0.08%)4.87s4.96s
System
Machine Namets-ci-ubuntu
Platformlinux 5.4.0-131-generic
Architecturex64
Available Memory16 GB
Available Memory15 GB
CPUs4 × Intel(R) Core(TM) i7-4770 CPU @ 3.40GHz
Hosts
  • node (v18.10.0, x64)
  • node (v16.17.1, x64)
  • node (v14.15.1, x64)
Scenarios
  • Angular - node (v18.10.0, x64)
  • Angular - node (v16.17.1, x64)
  • Angular - node (v14.15.1, x64)
  • Compiler-Unions - node (v18.10.0, x64)
  • Compiler-Unions - node (v16.17.1, x64)
  • Compiler-Unions - node (v14.15.1, x64)
  • Monaco - node (v18.10.0, x64)
  • Monaco - node (v16.17.1, x64)
  • Monaco - node (v14.15.1, x64)
  • TFS - node (v18.10.0, x64)
  • TFS - node (v16.17.1, x64)
  • TFS - node (v14.15.1, x64)
  • material-ui - node (v18.10.0, x64)
  • material-ui - node (v16.17.1, x64)
  • material-ui - node (v14.15.1, x64)
  • xstate - node (v18.10.0, x64)
  • xstate - node (v16.17.1, x64)
  • xstate - node (v14.15.1, x64)
BenchmarkNameIterations
Current5168210
Baselinemain10

TSServer

Comparison Report - main..51682
Metricmain51682DeltaBestWorst
Compiler-UnionsTSServer - node (v18.10.0, x64)
Req 1 - updateOpen1,053ms (± 0.88%)1,057ms (± 0.67%)+4ms (+ 0.39%)1,040ms1,077ms
Req 2 - geterr2,587ms (± 0.60%)2,545ms (± 0.78%)-42ms (- 1.62%)2,502ms2,587ms
Req 3 - references165ms (± 0.62%)165ms (± 0.55%)-0ms (- 0.12%)163ms167ms
Req 4 - navto138ms (± 1.13%)142ms (± 0.78%)+4ms (+ 2.60%)140ms145ms
Req 5 - completionInfo count1,356 (± 0.00%)1,356 (± 0.00%)0 ( 0.00%)1,3561,356
Req 5 - completionInfo60ms (± 4.33%)55ms (± 8.59%)🟩-5ms (- 7.82%)49ms62ms
CompilerTSServer - node (v18.10.0, x64)
Req 1 - updateOpen1,100ms (± 0.45%)1,132ms (± 0.38%)+32ms (+ 2.91%)1,120ms1,140ms
Req 2 - geterr1,599ms (± 0.59%)1,566ms (± 0.63%)-33ms (- 2.07%)1,545ms1,598ms
Req 3 - references168ms (± 0.54%)174ms (± 1.10%)+7ms (+ 3.87%)169ms177ms
Req 4 - navto151ms (± 0.83%)152ms (± 0.88%)+1ms (+ 0.60%)149ms155ms
Req 5 - completionInfo count1,518 (± 0.00%)1,518 (± 0.00%)0 ( 0.00%)1,5181,518
Req 5 - completionInfo53ms (± 1.13%)52ms (± 1.30%)-0ms (- 0.38%)51ms54ms
xstateTSServer - node (v18.10.0, x64)
Req 1 - updateOpen1,508ms (± 0.52%)1,534ms (± 1.08%)+26ms (+ 1.72%)1,492ms1,564ms
Req 2 - geterr554ms (± 0.70%)544ms (± 1.29%)-10ms (- 1.75%)527ms557ms
Req 3 - references59ms (± 2.35%)60ms (± 2.16%)+1ms (+ 1.88%)56ms62ms
Req 4 - navto195ms (± 0.54%)193ms (± 0.60%)-2ms (- 1.23%)191ms195ms
Req 5 - completionInfo count3,154 (± 0.00%)3,154 (± 0.00%)0 ( 0.00%)3,1543,154
Req 5 - completionInfo215ms (± 1.76%)212ms (± 1.07%)-3ms (- 1.21%)207ms216ms
Compiler-UnionsTSServer - node (v16.17.1, x64)
Req 1 - updateOpen1,296ms (± 0.46%)1,316ms (± 0.35%)+20ms (+ 1.57%)1,302ms1,326ms
Req 2 - geterr3,187ms (± 0.71%)3,154ms (± 0.90%)-33ms (- 1.02%)3,086ms3,223ms
Req 3 - references191ms (± 0.90%)194ms (± 1.05%)+3ms (+ 1.62%)191ms199ms
Req 4 - navto151ms (± 0.63%)155ms (± 0.95%)+4ms (+ 2.72%)152ms159ms
Req 5 - completionInfo count1,356 (± 0.00%)1,356 (± 0.00%)0 ( 0.00%)1,3561,356
Req 5 - completionInfo64ms (±13.05%)58ms (± 2.06%)🟩-6ms (- 9.55%)56ms62ms
CompilerTSServer - node (v16.17.1, x64)
Req 1 - updateOpen1,384ms (± 0.61%)1,411ms (± 0.55%)+26ms (+ 1.89%)1,391ms1,426ms
Req 2 - geterr2,105ms (± 0.31%)2,071ms (± 0.68%)-33ms (- 1.58%)2,041ms2,098ms
Req 3 - references199ms (± 0.82%)201ms (± 0.47%)+2ms (+ 1.01%)199ms203ms
Req 4 - navto166ms (± 1.67%)165ms (± 0.48%)-1ms (- 0.30%)163ms167ms
Req 5 - completionInfo count1,518 (± 0.00%)1,518 (± 0.00%)0 ( 0.00%)1,5181,518
Req 5 - completionInfo56ms (± 2.89%)56ms (± 1.47%)+0ms (+ 0.18%)55ms59ms
xstateTSServer - node (v16.17.1, x64)
Req 1 - updateOpen1,811ms (± 0.38%)1,858ms (± 0.45%)+47ms (+ 2.58%)1,839ms1,875ms
Req 2 - geterr724ms (± 0.31%)689ms (± 0.50%)🟩-34ms (- 4.74%)681ms695ms
Req 3 - references68ms (± 1.48%)66ms (± 0.98%)-2ms (- 2.22%)65ms68ms
Req 4 - navto199ms (± 0.73%)196ms (± 1.18%)-3ms (- 1.46%)191ms201ms
Req 5 - completionInfo count3,154 (± 0.00%)3,154 (± 0.00%)0 ( 0.00%)3,1543,154
Req 5 - completionInfo254ms (± 0.99%)253ms (± 1.18%)-1ms (- 0.35%)249ms262ms
Compiler-UnionsTSServer - node (v14.15.1, x64)
Req 1 - updateOpen1,451ms (± 0.41%)1,478ms (± 0.29%)+26ms (+ 1.81%)1,470ms1,487ms
Req 2 - geterr3,435ms (± 0.66%)3,357ms (± 0.43%)-77ms (- 2.25%)3,326ms3,392ms
Req 3 - references206ms (± 0.65%)208ms (± 0.80%)+3ms (+ 1.36%)205ms212ms
Req 4 - navto162ms (± 0.73%)169ms (± 1.10%)+6ms (+ 3.95%)164ms173ms
Req 5 - completionInfo count1,356 (± 0.00%)1,356 (± 0.00%)0 ( 0.00%)1,3561,356
Req 5 - completionInfo57ms (± 1.04%)58ms (± 1.37%)+1ms (+ 1.39%)57ms61ms
CompilerTSServer - node (v14.15.1, x64)
Req 1 - updateOpen1,525ms (± 0.43%)1,570ms (± 0.43%)+45ms (+ 2.98%)1,559ms1,589ms
Req 2 - geterr2,288ms (± 0.41%)2,209ms (± 0.44%)🟩-79ms (- 3.43%)2,194ms2,245ms
Req 3 - references218ms (± 1.02%)221ms (± 0.89%)+4ms (+ 1.75%)218ms227ms
Req 4 - navto173ms (± 0.85%)179ms (± 0.50%)+5ms (+ 3.12%)177ms181ms
Req 5 - completionInfo count1,518 (± 0.00%)1,518 (± 0.00%)0 ( 0.00%)1,5181,518
Req 5 - completionInfo56ms (± 0.93%)60ms (± 5.70%)+4ms (+ 6.80%)56ms72ms
xstateTSServer - node (v14.15.1, x64)
Req 1 - updateOpen1,993ms (± 0.50%)1,967ms (± 0.37%)-26ms (- 1.31%)1,954ms1,981ms
Req 2 - geterr745ms (± 0.42%)738ms (± 0.50%)-7ms (- 0.97%)730ms746ms
Req 3 - references72ms (± 0.86%)74ms (± 1.38%)+2ms (+ 2.50%)72ms76ms
Req 4 - navto218ms (± 0.45%)212ms (± 0.41%)-6ms (- 2.66%)211ms214ms
Req 5 - completionInfo count3,154 (± 0.00%)3,154 (± 0.00%)0 ( 0.00%)3,1543,154
Req 5 - completionInfo270ms (± 1.16%)279ms (± 1.48%)+9ms (+ 3.41%)271ms288ms
System
Machine Namets-ci-ubuntu
Platformlinux 5.4.0-131-generic
Architecturex64
Available Memory16 GB
Available Memory15 GB
CPUs4 × Intel(R) Core(TM) i7-4770 CPU @ 3.40GHz
Hosts
  • node (v18.10.0, x64)
  • node (v16.17.1, x64)
  • node (v14.15.1, x64)
Scenarios
  • Compiler-UnionsTSServer - node (v18.10.0, x64)
  • Compiler-UnionsTSServer - node (v16.17.1, x64)
  • Compiler-UnionsTSServer - node (v14.15.1, x64)
  • CompilerTSServer - node (v18.10.0, x64)
  • CompilerTSServer - node (v16.17.1, x64)
  • CompilerTSServer - node (v14.15.1, x64)
  • xstateTSServer - node (v18.10.0, x64)
  • xstateTSServer - node (v16.17.1, x64)
  • xstateTSServer - node (v14.15.1, x64)
BenchmarkNameIterations
Current5168210
Baselinemain10

Startup

Comparison Report - main..51682
Metricmain51682DeltaBestWorst
tsc-startup - node (v16.17.1, x64)
Execution time117.61ms (± 0.39%)117.24ms (± 0.38%)-0.37ms (- 0.32%)115.28ms124.36ms
tsserver-startup - node (v16.17.1, x64)
Execution time197.48ms (± 0.29%)197.03ms (± 0.30%)-0.45ms (- 0.23%)194.18ms212.27ms
tsserverlibrary-startup - node (v16.17.1, x64)
Execution time191.93ms (± 0.30%)191.74ms (± 0.31%)-0.19ms (- 0.10%)188.43ms200.56ms
typescript-startup - node (v16.17.1, x64)
Execution time177.12ms (± 0.27%)177.56ms (± 0.39%)+0.44ms (+ 0.25%)174.81ms184.54ms
System
Machine Namets-ci-ubuntu
Platformlinux 5.4.0-131-generic
Architecturex64
Available Memory16 GB
Available Memory15 GB
CPUs4 × Intel(R) Core(TM) i7-4770 CPU @ 3.40GHz
Hosts
  • node (v16.17.1, x64)
Scenarios
  • tsc-startup - node (v16.17.1, x64)
  • tsserver-startup - node (v16.17.1, x64)
  • tsserverlibrary-startup - node (v16.17.1, x64)
  • typescript-startup - node (v16.17.1, x64)
BenchmarkNameIterations
Current5168210
Baselinemain10

Developer Information:

Download Benchmark

@rbuckton

I'm going to temporarily borrow this PR to see if the benefit I saw locally in #51788 was a knock-on effect from the changes in this PR, since #51788 isn't having the same impact in benchmarks as I was expecting. If it does improve, I'll leave it in and close the other one.

@rbuckton

@typescript-bot perf test

@typescript-bot

Heya @rbuckton, I've started to run the perf test suite on this PR at 5f84fc6. You can monitor the build here.

Update: The results are in!

@typescript-bot

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

Here they are:

Compiler

Comparison Report - main..51682
Metricmain51682DeltaBestWorst
Angular - node (v18.10.0, x64)
Memory used341,113k (± 0.01%)364,455k (± 0.02%)+23,342k (+ 6.84%)364,285k364,556k
Parse Time1.57s (± 0.79%)1.58s (± 0.89%)+0.01s (+ 0.83%)1.55s1.61s
Bind Time0.52s (± 0.69%)0.55s (± 1.17%)+0.03s (+ 5.34%)0.54s0.57s
Check Time4.03s (± 0.63%)3.91s (± 0.92%)-0.11s (- 2.85%)3.83s3.99s
Emit Time4.28s (± 0.99%)3.97s (± 1.34%)🟩-0.30s (- 7.09%)3.85s4.07s
Total Time10.40s (± 0.61%)10.03s (± 0.85%)🟩-0.37s (- 3.58%)9.85s10.18s
Compiler-Unions - node (v18.10.0, x64)
Memory used187,917k (± 1.11%)199,605k (± 1.08%)+11,688k (+ 6.22%)196,425k202,519k
Parse Time0.61s (± 0.95%)0.63s (± 1.32%)+0.01s (+ 2.12%)0.61s0.65s
Bind Time0.33s (± 1.53%)0.35s (± 0.84%)+0.03s (+ 8.31%)0.35s0.36s
Check Time4.99s (± 0.61%)4.97s (± 0.67%)-0.02s (- 0.38%)4.87s5.04s
Emit Time1.55s (± 0.68%)1.46s (± 1.35%)🟩-0.09s (- 5.73%)1.43s1.50s
Total Time7.48s (± 0.55%)7.42s (± 0.65%)-0.07s (- 0.90%)7.27s7.51s
Monaco - node (v18.10.0, x64)
Memory used320,542k (± 0.05%)347,224k (± 0.01%)+26,682k (+ 8.32%)347,118k347,307k
Parse Time1.16s (± 1.76%)1.18s (± 0.95%)+0.03s (+ 2.25%)1.16s1.21s
Bind Time0.48s (± 1.20%)0.51s (± 1.46%)+0.03s (+ 5.59%)0.50s0.53s
Check Time3.84s (± 0.65%)3.67s (± 0.55%)🟩-0.17s (- 4.43%)3.63s3.71s
Emit Time2.25s (± 0.79%)2.06s (± 0.98%)🟩-0.19s (- 8.45%)2.01s2.09s
Total Time7.72s (± 0.40%)7.42s (± 0.61%)🟩-0.30s (- 3.94%)7.32s7.50s
TFS - node (v18.10.0, x64)
Memory used283,509k (± 0.23%)305,436k (± 0.23%)+21,928k (+ 7.73%)304,687k306,931k
Parse Time0.96s (± 0.92%)0.96s (± 1.09%)+0.00s (+ 0.10%)0.94s0.99s
Bind Time0.45s (± 7.33%)0.57s (± 2.60%)+0.12s (+26.49%)0.53s0.59s
Check Time3.80s (± 0.50%)3.40s (± 0.53%)🟩-0.40s (-10.53%)3.34s3.42s
Emit Time2.21s (± 0.85%)2.04s (± 1.12%)🟩-0.16s (- 7.43%)2.00s2.09s
Total Time7.42s (± 0.48%)6.97s (± 0.67%)🟩-0.45s (- 6.01%)6.85s7.06s
material-ui - node (v18.10.0, x64)
Memory used436,020k (± 0.02%)451,578k (± 0.01%)+15,559k (+ 3.57%)451,516k451,641k
Parse Time1.32s (± 0.77%)1.35s (± 0.99%)+0.04s (+ 2.96%)1.33s1.39s
Bind Time0.49s (± 1.64%)0.43s (± 2.56%)🟩-0.05s (-11.07%)0.41s0.45s
Check Time10.32s (± 0.65%)10.27s (± 0.92%)-0.05s (- 0.50%)10.07s10.44s
Emit Time0.00s (± 0.00%)0.00s (± 0.00%)0.00s ( NaN%)0.00s0.00s
Total Time12.13s (± 0.59%)12.06s (± 0.78%)-0.07s (- 0.57%)11.87s12.22s
xstate - node (v18.10.0, x64)
Memory used518,646k (± 0.01%)553,384k (± 0.01%)+34,738k (+ 6.70%)553,291k553,578k
Parse Time1.88s (± 0.72%)1.92s (± 0.65%)+0.04s (+ 2.23%)1.89s1.95s
Bind Time0.69s (± 1.80%)0.72s (± 1.48%)+0.02s (+ 3.17%)0.69s0.74s
Check Time1.04s (± 0.83%)1.03s (± 1.12%)-0.00s (- 0.48%)1.01s1.05s
Emit Time0.05s (± 0.00%)0.05s (± 0.00%)0.00s ( 0.00%)0.05s0.05s
Total Time3.67s (± 0.52%)3.73s (± 0.69%)+0.06s (+ 1.58%)3.67s3.78s
Angular - node (v16.17.1, x64)
Memory used340,529k (± 0.01%)363,781k (± 0.02%)+23,253k (+ 6.83%)363,571k363,887k
Parse Time1.86s (± 0.64%)1.93s (± 0.83%)+0.06s (+ 3.49%)1.89s1.96s
Bind Time0.64s (± 1.06%)0.67s (± 0.51%)+0.02s (+ 3.57%)0.66s0.67s
Check Time5.15s (± 0.70%)5.04s (± 0.28%)-0.11s (- 2.12%)5.01s5.08s
Emit Time5.13s (± 1.44%)4.71s (± 1.33%)🟩-0.42s (- 8.19%)4.57s4.81s
Total Time12.78s (± 0.80%)12.34s (± 0.73%)🟩-0.44s (- 3.46%)12.19s12.51s
Compiler-Unions - node (v16.17.1, x64)
Memory used187,680k (± 0.59%)200,514k (± 0.62%)+12,834k (+ 6.84%)198,430k202,000k
Parse Time0.80s (± 1.27%)0.80s (± 0.70%)+0.00s (+ 0.38%)0.79s0.81s
Bind Time0.42s (± 1.76%)0.44s (± 1.11%)+0.02s (+ 4.96%)0.43s0.45s
Check Time6.13s (± 1.58%)5.93s (± 0.67%)🟩-0.20s (- 3.29%)5.84s6.05s
Emit Time1.95s (± 1.56%)1.81s (± 0.94%)🟩-0.15s (- 7.43%)1.78s1.84s
Total Time9.30s (± 1.44%)8.98s (± 0.49%)🟩-0.32s (- 3.47%)8.86s9.08s
Monaco - node (v16.17.1, x64)
Memory used319,822k (± 0.05%)346,520k (± 0.01%)+26,698k (+ 8.35%)346,361k346,589k
Parse Time1.41s (± 0.95%)1.45s (± 0.79%)+0.04s (+ 2.91%)1.42s1.47s
Bind Time0.59s (± 0.76%)0.61s (± 0.80%)+0.03s (+ 4.42%)0.61s0.63s
Check Time4.90s (± 1.15%)4.62s (± 0.38%)🟩-0.27s (- 5.60%)4.59s4.66s
Emit Time2.72s (± 0.59%)2.50s (± 1.11%)🟩-0.22s (- 8.20%)2.44s2.59s
Total Time9.61s (± 0.60%)9.18s (± 0.41%)🟩-0.44s (- 4.54%)9.08s9.29s
TFS - node (v16.17.1, x64)
Memory used282,296k (± 0.01%)304,116k (± 0.02%)+21,820k (+ 7.73%)303,950k304,218k
Parse Time1.15s (± 0.84%)1.19s (± 1.15%)+0.04s (+ 3.21%)1.17s1.24s
Bind Time0.63s (± 5.73%)0.58s (± 1.06%)🟩-0.05s (- 8.07%)0.57s0.59s
Check Time4.77s (± 0.36%)4.33s (± 0.38%)🟩-0.44s (- 9.20%)4.29s4.36s
Emit Time2.74s (± 1.85%)2.49s (± 0.70%)🟩-0.25s (- 9.12%)2.46s2.53s
Total Time9.29s (± 0.76%)8.59s (± 0.35%)🟩-0.70s (- 7.58%)8.52s8.64s
material-ui - node (v16.17.1, x64)
Memory used435,337k (± 0.01%)450,978k (± 0.01%)+15,641k (+ 3.59%)450,919k451,122k
Parse Time1.62s (± 0.55%)1.68s (± 0.42%)+0.06s (+ 3.96%)1.67s1.70s
Bind Time0.51s (± 0.94%)0.50s (± 1.04%)-0.01s (- 1.18%)0.49s0.51s
Check Time11.80s (± 0.91%)11.75s (± 0.59%)-0.04s (- 0.36%)11.59s11.89s
Emit Time0.00s (± 0.00%)0.00s (± 0.00%)0.00s ( NaN%)0.00s0.00s
Total Time13.92s (± 0.79%)13.94s (± 0.54%)+0.02s (+ 0.11%)13.77s14.08s
xstate - node (v16.17.1, x64)
Memory used516,206k (± 0.01%)550,964k (± 0.01%)+34,758k (+ 6.73%)550,864k551,120k
Parse Time2.27s (± 0.42%)2.33s (± 0.60%)+0.06s (+ 2.82%)2.30s2.36s
Bind Time0.82s (± 1.15%)0.82s (± 2.29%)-0.00s (- 0.24%)0.77s0.86s
Check Time1.35s (± 0.79%)1.34s (± 0.35%)-0.01s (- 0.59%)1.33s1.35s
Emit Time0.06s (± 0.00%)0.06s (± 0.00%)0.00s ( 0.00%)0.06s0.06s
Total Time4.50s (± 0.51%)4.56s (± 0.44%)+0.06s (+ 1.27%)4.51s4.59s
Angular - node (v14.15.1, x64)
Memory used334,006k (± 0.00%)357,653k (± 0.01%)+23,647k (+ 7.08%)357,599k357,694k
Parse Time2.04s (± 0.54%)2.06s (± 0.39%)+0.02s (+ 1.08%)2.05s2.08s
Bind Time0.70s (± 1.27%)0.71s (± 0.51%)+0.02s (+ 2.44%)0.71s0.72s
Check Time5.50s (± 0.31%)5.37s (± 0.46%)-0.13s (- 2.44%)5.30s5.41s
Emit Time5.38s (± 0.47%)4.83s (± 0.60%)🟩-0.56s (-10.33%)4.76s4.91s
Total Time13.62s (± 0.31%)12.97s (± 0.37%)🟩-0.65s (- 4.78%)12.83s13.11s
Compiler-Unions - node (v14.15.1, x64)
Memory used183,635k (± 0.65%)196,534k (± 0.39%)+12,900k (+ 7.02%)193,417k196,969k
Parse Time0.89s (± 0.58%)0.91s (± 1.04%)+0.02s (+ 2.02%)0.89s0.93s
Bind Time0.46s (± 0.82%)0.47s (± 0.77%)+0.02s (+ 4.18%)0.47s0.48s
Check Time6.35s (± 0.61%)6.18s (± 0.42%)-0.17s (- 2.74%)6.14s6.26s
Emit Time2.05s (± 0.96%)1.91s (± 0.57%)🟩-0.14s (- 6.78%)1.89s1.93s
Total Time9.75s (± 0.56%)9.47s (± 0.37%)-0.28s (- 2.86%)9.42s9.57s
Monaco - node (v14.15.1, x64)
Memory used314,612k (± 0.01%)341,514k (± 0.01%)+26,902k (+ 8.55%)341,475k341,551k
Parse Time1.56s (± 0.37%)1.58s (± 0.59%)+0.02s (+ 1.28%)1.57s1.60s
Bind Time0.63s (± 0.47%)0.65s (± 1.15%)+0.02s (+ 2.37%)0.64s0.67s
Check Time5.17s (± 0.25%)4.94s (± 0.48%)🟩-0.23s (- 4.41%)4.90s4.99s
Emit Time2.88s (± 0.63%)2.60s (± 0.66%)🟩-0.28s (- 9.68%)2.57s2.64s
Total Time10.24s (± 0.27%)9.77s (± 0.33%)🟩-0.47s (- 4.59%)9.71s9.83s
TFS - node (v14.15.1, x64)
Memory used279,374k (± 0.01%)301,284k (± 0.01%)+21,910k (+ 7.84%)301,253k301,329k
Parse Time1.32s (± 1.13%)1.33s (± 1.08%)+0.00s (+ 0.23%)1.30s1.36s
Bind Time0.59s (± 0.84%)0.61s (± 1.06%)+0.02s (+ 3.75%)0.60s0.62s
Check Time5.10s (± 0.44%)4.62s (± 0.35%)🟩-0.47s (- 9.30%)4.58s4.65s
Emit Time3.09s (± 0.72%)2.77s (± 0.79%)🟩-0.32s (-10.39%)2.73s2.82s
Total Time10.10s (± 0.44%)9.33s (± 0.45%)🟩-0.77s (- 7.62%)9.22s9.43s
material-ui - node (v14.15.1, x64)
Memory used430,824k (± 0.01%)446,772k (± 0.00%)+15,948k (+ 3.70%)446,748k446,810k
Parse Time1.86s (± 0.51%)1.89s (± 0.64%)+0.03s (+ 1.83%)1.87s1.93s
Bind Time0.53s (± 0.69%)0.54s (± 0.63%)+0.02s (+ 3.23%)0.54s0.55s
Check Time12.27s (± 0.60%)12.15s (± 0.73%)-0.12s (- 0.98%)11.98s12.42s
Emit Time0.00s (± 0.00%)0.00s (± 0.00%)0.00s ( NaN%)0.00s0.00s
Total Time14.66s (± 0.54%)14.58s (± 0.63%)-0.07s (- 0.51%)14.39s14.85s
xstate - node (v14.15.1, x64)
Memory used504,513k (± 0.01%)539,559k (± 0.01%)+35,046k (+ 6.95%)539,421k539,739k
Parse Time2.58s (± 0.70%)2.63s (± 0.67%)+0.05s (+ 1.82%)2.60s2.68s
Bind Time0.84s (± 0.44%)0.82s (± 0.57%)-0.02s (- 1.91%)0.81s0.83s
Check Time1.47s (± 0.60%)1.45s (± 0.74%)-0.02s (- 1.43%)1.43s1.48s
Emit Time0.07s (± 0.00%)0.07s (± 0.00%)0.00s ( 0.00%)0.07s0.07s
Total Time4.96s (± 0.31%)4.97s (± 0.48%)+0.01s (+ 0.28%)4.92s5.03s
System
Machine Namets-ci-ubuntu
Platformlinux 5.4.0-131-generic
Architecturex64
Available Memory16 GB
Available Memory15 GB
CPUs4 × Intel(R) Core(TM) i7-4770 CPU @ 3.40GHz
Hosts
  • node (v18.10.0, x64)
  • node (v16.17.1, x64)
  • node (v14.15.1, x64)
Scenarios
  • Angular - node (v18.10.0, x64)
  • Angular - node (v16.17.1, x64)
  • Angular - node (v14.15.1, x64)
  • Compiler-Unions - node (v18.10.0, x64)
  • Compiler-Unions - node (v16.17.1, x64)
  • Compiler-Unions - node (v14.15.1, x64)
  • Monaco - node (v18.10.0, x64)
  • Monaco - node (v16.17.1, x64)
  • Monaco - node (v14.15.1, x64)
  • TFS - node (v18.10.0, x64)
  • TFS - node (v16.17.1, x64)
  • TFS - node (v14.15.1, x64)
  • material-ui - node (v18.10.0, x64)
  • material-ui - node (v16.17.1, x64)
  • material-ui - node (v14.15.1, x64)
  • xstate - node (v18.10.0, x64)
  • xstate - node (v16.17.1, x64)
  • xstate - node (v14.15.1, x64)
BenchmarkNameIterations
Current5168210
Baselinemain10

TSServer

Comparison Report - main..51682
Metricmain51682DeltaBestWorst
Compiler-UnionsTSServer - node (v18.10.0, x64)
Req 1 - updateOpen1,054ms (± 0.83%)1,069ms (± 0.59%)+15ms (+ 1.39%)1,056ms1,081ms
Req 2 - geterr2,596ms (± 0.79%)2,564ms (± 1.03%)-32ms (- 1.23%)2,523ms2,645ms
Req 3 - references165ms (± 0.39%)165ms (± 0.63%)-0ms (- 0.24%)162ms167ms
Req 4 - navto138ms (± 0.64%)143ms (± 1.04%)+5ms (+ 3.63%)140ms146ms
Req 5 - completionInfo count1,356 (± 0.00%)1,356 (± 0.00%)0 ( 0.00%)1,3561,356
Req 5 - completionInfo61ms (± 2.00%)57ms (± 7.93%)🟩-4ms (- 6.57%)49ms63ms
CompilerTSServer - node (v18.10.0, x64)
Req 1 - updateOpen1,108ms (± 0.80%)1,138ms (± 0.49%)+30ms (+ 2.73%)1,124ms1,147ms
Req 2 - geterr1,605ms (± 0.56%)1,570ms (± 0.81%)-35ms (- 2.18%)1,544ms1,607ms
Req 3 - references168ms (± 0.55%)173ms (± 1.30%)+5ms (+ 3.03%)170ms180ms
Req 4 - navto152ms (± 0.58%)154ms (± 0.66%)+2ms (+ 1.25%)152ms156ms
Req 5 - completionInfo count1,518 (± 0.00%)1,518 (± 0.00%)0 ( 0.00%)1,5181,518
Req 5 - completionInfo53ms (± 1.13%)53ms (± 1.32%)+1ms (+ 0.95%)51ms54ms
xstateTSServer - node (v18.10.0, x64)
Req 1 - updateOpen1,507ms (± 0.55%)1,553ms (± 0.99%)+45ms (+ 3.01%)1,524ms1,576ms
Req 2 - geterr553ms (± 0.55%)545ms (± 1.25%)-9ms (- 1.59%)535ms561ms
Req 3 - references58ms (± 1.04%)58ms (± 2.46%)+0ms (+ 0.70%)54ms61ms
Req 4 - navto196ms (± 0.93%)196ms (± 1.14%)-0ms (- 0.20%)191ms202ms
Req 5 - completionInfo count3,154 (± 0.00%)3,154 (± 0.00%)0 ( 0.00%)3,1543,154
Req 5 - completionInfo213ms (± 1.68%)213ms (± 1.10%)+1ms (+ 0.24%)209ms218ms
Compiler-UnionsTSServer - node (v16.17.1, x64)
Req 1 - updateOpen1,300ms (± 0.54%)1,335ms (± 0.53%)+35ms (+ 2.72%)1,321ms1,348ms
Req 2 - geterr3,209ms (± 0.80%)3,174ms (± 0.91%)-35ms (- 1.10%)3,120ms3,254ms
Req 3 - references192ms (± 0.78%)195ms (± 0.73%)+4ms (+ 1.88%)192ms198ms
Req 4 - navto151ms (± 0.71%)157ms (± 0.53%)+5ms (+ 3.57%)154ms158ms
Req 5 - completionInfo count1,356 (± 0.00%)1,356 (± 0.00%)0 ( 0.00%)1,3561,356
Req 5 - completionInfo61ms (± 3.95%)58ms (± 1.62%)🟩-3ms (- 5.38%)57ms60ms
CompilerTSServer - node (v16.17.1, x64)
Req 1 - updateOpen1,386ms (± 1.03%)1,423ms (± 0.64%)+37ms (+ 2.69%)1,403ms1,445ms
Req 2 - geterr2,113ms (± 0.52%)2,076ms (± 0.36%)-37ms (- 1.75%)2,055ms2,087ms
Req 3 - references198ms (± 0.58%)202ms (± 0.66%)+4ms (+ 2.17%)200ms206ms
Req 4 - navto164ms (± 0.76%)167ms (± 0.73%)+3ms (+ 1.58%)164ms170ms
Req 5 - completionInfo count1,518 (± 0.00%)1,518 (± 0.00%)0 ( 0.00%)1,5181,518
Req 5 - completionInfo57ms (± 2.65%)57ms (± 1.14%)+0ms (+ 0.53%)55ms58ms
xstateTSServer - node (v16.17.1, x64)
Req 1 - updateOpen1,823ms (± 0.45%)1,880ms (± 0.40%)+57ms (+ 3.10%)1,864ms1,895ms
Req 2 - geterr725ms (± 0.74%)696ms (± 0.64%)🟩-29ms (- 4.04%)683ms704ms
Req 3 - references68ms (± 0.98%)66ms (± 1.21%)🟩-2ms (- 3.07%)65ms68ms
Req 4 - navto201ms (± 0.68%)197ms (± 1.01%)-4ms (- 1.74%)193ms201ms
Req 5 - completionInfo count3,154 (± 0.00%)3,154 (± 0.00%)0 ( 0.00%)3,1543,154
Req 5 - completionInfo254ms (± 0.99%)255ms (± 1.18%)+2ms (+ 0.67%)248ms261ms
Compiler-UnionsTSServer - node (v14.15.1, x64)
Req 1 - updateOpen1,451ms (± 0.64%)1,481ms (± 0.62%)+30ms (+ 2.06%)1,464ms1,506ms
Req 2 - geterr3,435ms (± 0.75%)3,377ms (± 0.64%)-58ms (- 1.70%)3,332ms3,417ms
Req 3 - references205ms (± 0.83%)209ms (± 0.46%)+3ms (+ 1.51%)207ms211ms
Req 4 - navto162ms (± 0.91%)170ms (± 0.55%)+8ms (+ 4.81%)167ms171ms
Req 5 - completionInfo count1,356 (± 0.00%)1,356 (± 0.00%)0 ( 0.00%)1,3561,356
Req 5 - completionInfo57ms (± 1.08%)60ms (± 5.17%)+3ms (+ 5.62%)57ms72ms
CompilerTSServer - node (v14.15.1, x64)
Req 1 - updateOpen1,524ms (± 0.26%)1,582ms (± 0.65%)+59ms (+ 3.84%)1,554ms1,607ms
Req 2 - geterr2,302ms (± 0.56%)2,214ms (± 0.39%)🟩-87ms (- 3.79%)2,203ms2,243ms
Req 3 - references218ms (± 1.04%)222ms (± 1.12%)+5ms (+ 2.16%)219ms230ms
Req 4 - navto175ms (± 0.46%)179ms (± 0.97%)+4ms (+ 2.23%)175ms183ms
Req 5 - completionInfo count1,518 (± 0.00%)1,518 (± 0.00%)0 ( 0.00%)1,5181,518
Req 5 - completionInfo56ms (± 0.90%)61ms (± 5.93%)+5ms (+ 9.55%)57ms74ms
xstateTSServer - node (v14.15.1, x64)
Req 1 - updateOpen1,999ms (± 0.45%)1,990ms (± 0.79%)-9ms (- 0.45%)1,963ms2,024ms
Req 2 - geterr746ms (± 0.72%)745ms (± 0.63%)-1ms (- 0.13%)737ms757ms
Req 3 - references71ms (± 2.01%)75ms (± 1.85%)+3ms (+ 4.78%)72ms77ms
Req 4 - navto219ms (± 0.50%)216ms (± 0.58%)-3ms (- 1.42%)213ms219ms
Req 5 - completionInfo count3,154 (± 0.00%)3,154 (± 0.00%)0 ( 0.00%)3,1543,154
Req 5 - completionInfo270ms (± 0.63%)283ms (± 1.56%)+14ms (+ 5.04%)272ms290ms
System
Machine Namets-ci-ubuntu
Platformlinux 5.4.0-131-generic
Architecturex64
Available Memory16 GB
Available Memory15 GB
CPUs4 × Intel(R) Core(TM) i7-4770 CPU @ 3.40GHz
Hosts
  • node (v18.10.0, x64)
  • node (v16.17.1, x64)
  • node (v14.15.1, x64)
Scenarios
  • Compiler-UnionsTSServer - node (v18.10.0, x64)
  • Compiler-UnionsTSServer - node (v16.17.1, x64)
  • Compiler-UnionsTSServer - node (v14.15.1, x64)
  • CompilerTSServer - node (v18.10.0, x64)
  • CompilerTSServer - node (v16.17.1, x64)
  • CompilerTSServer - node (v14.15.1, x64)
  • xstateTSServer - node (v18.10.0, x64)
  • xstateTSServer - node (v16.17.1, x64)
  • xstateTSServer - node (v14.15.1, x64)
BenchmarkNameIterations
Current5168210
Baselinemain10

Startup

Comparison Report - main..51682
Metricmain51682DeltaBestWorst
tsc-startup - node (v16.17.1, x64)
Execution time117.55ms (± 0.36%)119.68ms (± 0.55%)+2.13ms (+ 1.81%)116.53ms125.10ms
tsserver-startup - node (v16.17.1, x64)
Execution time197.81ms (± 0.28%)202.69ms (± 0.50%)+4.88ms (+ 2.47%)196.44ms212.66ms
tsserverlibrary-startup - node (v16.17.1, x64)
Execution time192.24ms (± 0.31%)196.72ms (± 0.38%)+4.48ms (+ 2.33%)191.07ms205.50ms
typescript-startup - node (v16.17.1, x64)
Execution time177.21ms (± 0.30%)181.51ms (± 0.36%)+4.30ms (+ 2.43%)176.52ms188.28ms
System
Machine Namets-ci-ubuntu
Platformlinux 5.4.0-131-generic
Architecturex64
Available Memory16 GB
Available Memory15 GB
CPUs4 × Intel(R) Core(TM) i7-4770 CPU @ 3.40GHz
Hosts
  • node (v16.17.1, x64)
Scenarios
  • tsc-startup - node (v16.17.1, x64)
  • tsserver-startup - node (v16.17.1, x64)
  • tsserverlibrary-startup - node (v16.17.1, x64)
  • typescript-startup - node (v16.17.1, x64)
BenchmarkNameIterations
Current5168210
Baselinemain10

Developer Information:

Download Benchmark

@@ -2803,18 +2738,20 @@ function createBinder(): (file: SourceFile, options: CompilerOptions) => void {
}
// falls through
case SyntaxKind.ThisKeyword:
// TODO: Why use `isExpression` here? both Identifier and ThisKeyword are expressions.
Copy link
Member

Choose a reason for hiding this comment

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

IIRC this in a type position wasn't an expression, but was still parsed as a ThisKeyword for a period of time.

@rbuckton

I'm curious. How I can run the perf on my own project?

The tool we use for benchmarking isn't public, but it essentially just runs tsc --extendedDiagnostics repeatedly on various projects and summarizes the results.

I'm planning to publish the tool I wrote to analyze V8 maps and deoptimizations in the near future, however.

@Jack-Works

System info:

Node 19.2.0, Windows 10.0.22623, AMD64 Family 25 Model 33 Stepping 0 AuthenticAMD ~3701 Mhz

Project scale:

Projects in scope:                         75
Projects built:                            71
Aggregate Files:                        64824
Aggregate Lines of Library:            716308
Aggregate Lines of Definitions:       8345732
Aggregate Lines of TypeScript:         216245
Aggregate Lines of JavaScript:              0
Aggregate Lines of JSON:                40878
Aggregate Lines of Other:                   0

Perf result:

5.0.0-dev.20221207 => npm:@typescript-deploys/[email protected]

Aggregate Identifiers:                9923117
Aggregate Symbols:                    8689294 => 8689301
Aggregate Types:                       998455 => 998526
Aggregate Instantiations:             6990544
Aggregate Memory used:               2633329K => 2685920K
Aggregate Assignability cache size:    428849
Aggregate Identity cache size:          53133
Aggregate Subtype cache size:           49022
Aggregate Strict subtype cache size:    37922
Aggregate I/O Read time:                0.72s
Aggregate Parse time:                   2.23s => 2.32s
Aggregate ResolveModule time:           2.79s => 2.78s
Aggregate ResolveTypeReference time:    0.10s => 0.11s
Aggregate Program time:                10.15s => 10.23s
Aggregate Bind time:                    1.08s => 10.7s
Aggregate Check time:                  35.31s => 35.43s
Aggregate transformTime time:           5.92s => 5.81s
Aggregate Source Map time:              0.83s => 0.81s
Aggregate commentTime time:             1.19s => 0.16s
Aggregate printTime time:              19.76s => 19.60s
Aggregate Emit time:                   19.82s => 19.68s
Aggregate I/O Write time:               2.81s => 2.90s
Config file parsing time:               0.32s
Up-to-date check time:                  0.01s
Build time:                            90.30s => 90.60s

@rbucktonrbuckton marked this pull request as ready for review December 12, 2022 20:12
@@ -28,7 +28,7 @@ import {
BundleFileTextLikeKind,
CallExpression,
CallSignatureDeclaration,
CaseBlock,
canHaveLocals, CaseBlock,
Copy link
Member

Choose a reason for hiding this comment

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

There's no lint rule for this, but these should be columns.

Hopefully one day we can get formatting automated...

Copy link
Contributor

Choose a reason for hiding this comment

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

One day...
futuristic city

🤣 (sorry, I couldn't resist)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

There's no lint rule for this, but these should be columns.

Hopefully one day we can get formatting automated...

I've also noticed that Organize Imports seems to be sorting __String to the end rather than the start.

Copy link
Member

Choose a reason for hiding this comment

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

Yeah, that's: #51733

Sign up for free to join this conversation on . Already have an account? Sign in to comment
Author: Team For Uncommitted BugPR for untriaged, rejected, closed or missing bug
None yet

Successfully merging this pull request may close these issues.