Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a jump-table for visitEachChild #50266

Merged
merged 3 commits into from
Aug 18, 2022
Merged

Add a jump-table for visitEachChild #50266

merged 3 commits into from
Aug 18, 2022

Conversation

rbuckton
Copy link
Member

Similar to #50225, this creates a table to handle each potential syntax kind in visitEachChild.

@typescript-bot typescript-bot added Author: Team For Uncommitted Bug PR for untriaged, rejected, closed or missing bug labels Aug 10, 2022
@rbuckton
Copy link
Member Author

@typescript-bot perf test

@typescript-bot
Copy link
Collaborator

typescript-bot commented Aug 10, 2022

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

Update: The results are in!

@typescript-bot
Copy link
Collaborator

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

Here they are:

Compiler

Comparison Report - main..50266
Metric main 50266 Delta Best Worst
Angular - node (v10.16.3, x64)
Memory used 360,469k (± 0.02%) 360,554k (± 0.03%) +85k (+ 0.02%) 360,368k 360,748k
Parse Time 2.12s (± 0.46%) 2.11s (± 0.57%) -0.01s (- 0.33%) 2.08s 2.14s
Bind Time 0.89s (± 0.38%) 0.89s (± 0.82%) -0.00s (- 0.11%) 0.88s 0.91s
Check Time 6.06s (± 0.38%) 6.02s (± 0.41%) -0.04s (- 0.59%) 5.94s 6.06s
Emit Time 6.22s (± 0.58%) 5.99s (± 0.54%) 🟩-0.24s (- 3.78%) 5.91s 6.06s
Total Time 15.30s (± 0.32%) 15.02s (± 0.42%) -0.28s (- 1.81%) 14.82s 15.15s
Compiler-Unions - node (v10.16.3, x64)
Memory used 205,560k (± 0.03%) 205,725k (± 0.03%) +165k (+ 0.08%) 205,609k 205,866k
Parse Time 0.83s (± 0.98%) 0.83s (± 0.67%) -0.01s (- 0.60%) 0.82s 0.84s
Bind Time 0.53s (± 1.05%) 0.53s (± 1.04%) +0.00s (+ 0.76%) 0.52s 0.54s
Check Time 7.08s (± 0.63%) 7.12s (± 0.41%) +0.04s (+ 0.55%) 7.06s 7.19s
Emit Time 2.53s (± 0.74%) 2.45s (± 0.99%) 🟩-0.08s (- 3.24%) 2.37s 2.49s
Total Time 10.96s (± 0.47%) 10.92s (± 0.34%) -0.04s (- 0.38%) 10.85s 11.00s
Monaco - node (v10.16.3, x64)
Memory used 344,005k (± 0.02%) 344,143k (± 0.02%) +138k (+ 0.04%) 343,999k 344,243k
Parse Time 1.61s (± 0.78%) 1.62s (± 0.77%) +0.01s (+ 0.31%) 1.58s 1.63s
Bind Time 0.76s (± 0.79%) 0.76s (± 1.16%) +0.01s (+ 0.66%) 0.75s 0.79s
Check Time 6.04s (± 0.44%) 6.04s (± 0.36%) -0.01s (- 0.12%) 6.00s 6.09s
Emit Time 3.30s (± 0.63%) 3.21s (± 0.98%) -0.09s (- 2.61%) 3.16s 3.28s
Total Time 11.70s (± 0.33%) 11.62s (± 0.42%) -0.08s (- 0.68%) 11.54s 11.73s
TFS - node (v10.16.3, x64)
Memory used 305,269k (± 0.01%) 305,260k (± 0.02%) -8k (- 0.00%) 305,099k 305,362k
Parse Time 1.30s (± 0.58%) 1.30s (± 0.65%) +0.00s (+ 0.23%) 1.29s 1.33s
Bind Time 0.73s (± 0.82%) 0.73s (± 0.65%) +0.00s (+ 0.14%) 0.72s 0.74s
Check Time 5.47s (± 0.32%) 5.46s (± 0.52%) -0.00s (- 0.05%) 5.38s 5.51s
Emit Time 3.47s (± 1.22%) 3.40s (± 1.11%) -0.07s (- 1.96%) 3.31s 3.47s
Total Time 10.96s (± 0.47%) 10.89s (± 0.54%) -0.07s (- 0.64%) 10.73s 10.96s
material-ui - node (v10.16.3, x64)
Memory used 469,655k (± 0.01%) 469,659k (± 0.01%) +4k (+ 0.00%) 469,566k 469,753k
Parse Time 1.85s (± 0.58%) 1.86s (± 0.71%) +0.01s (+ 0.49%) 1.83s 1.89s
Bind Time 0.68s (± 1.44%) 0.68s (± 1.49%) -0.01s (- 0.88%) 0.66s 0.70s
Check Time 14.69s (± 0.56%) 14.75s (± 0.34%) +0.06s (+ 0.39%) 14.68s 14.91s
Emit Time 0.00s (± 0.00%) 0.00s (± 0.00%) 0.00s ( NaN%) 0.00s 0.00s
Total Time 17.22s (± 0.49%) 17.28s (± 0.31%) +0.06s (+ 0.37%) 17.22s 17.45s
xstate - node (v10.16.3, x64)
Memory used 578,808k (± 0.01%) 578,977k (± 0.02%) +169k (+ 0.03%) 578,720k 579,221k
Parse Time 2.62s (± 0.44%) 2.62s (± 0.40%) +0.00s (+ 0.19%) 2.60s 2.64s
Bind Time 1.03s (± 1.20%) 1.02s (± 1.49%) -0.00s (- 0.29%) 1.01s 1.08s
Check Time 1.57s (± 0.73%) 1.57s (± 0.56%) -0.00s (- 0.19%) 1.54s 1.58s
Emit Time 0.07s (± 0.00%) 0.07s (± 0.00%) 0.00s ( 0.00%) 0.07s 0.07s
Total Time 5.28s (± 0.43%) 5.28s (± 0.36%) -0.01s (- 0.09%) 5.25s 5.33s
Angular - node (v12.1.0, x64)
Memory used 338,132k (± 0.02%) 338,223k (± 0.02%) +91k (+ 0.03%) 338,037k 338,398k
Parse Time 2.10s (± 0.72%) 2.12s (± 0.62%) +0.02s (+ 0.86%) 2.09s 2.16s
Bind Time 0.85s (± 0.70%) 0.86s (± 0.80%) +0.00s (+ 0.23%) 0.84s 0.87s
Check Time 5.87s (± 0.34%) 5.86s (± 0.28%) -0.01s (- 0.19%) 5.81s 5.89s
Emit Time 6.43s (± 0.51%) 6.23s (± 0.84%) 🟩-0.20s (- 3.06%) 6.15s 6.36s
Total Time 15.26s (± 0.33%) 15.07s (± 0.34%) -0.19s (- 1.23%) 14.96s 15.20s
Compiler-Unions - node (v12.1.0, x64)
Memory used 193,278k (± 0.06%) 193,497k (± 0.03%) +219k (+ 0.11%) 193,323k 193,574k
Parse Time 0.83s (± 0.72%) 0.83s (± 0.98%) +0.01s (+ 0.85%) 0.82s 0.86s
Bind Time 0.56s (± 0.65%) 0.55s (± 0.66%) -0.00s (- 0.36%) 0.55s 0.56s
Check Time 6.71s (± 0.48%) 6.70s (± 0.49%) -0.01s (- 0.07%) 6.64s 6.79s
Emit Time 2.54s (± 1.64%) 2.46s (± 1.12%) 🟩-0.08s (- 3.26%) 2.41s 2.55s
Total Time 10.63s (± 0.60%) 10.54s (± 0.39%) -0.09s (- 0.83%) 10.47s 10.65s
Monaco - node (v12.1.0, x64)
Memory used 326,959k (± 0.03%) 327,081k (± 0.03%) +122k (+ 0.04%) 326,913k 327,304k
Parse Time 1.58s (± 1.00%) 1.59s (± 0.83%) +0.01s (+ 0.63%) 1.56s 1.63s
Bind Time 0.74s (± 1.00%) 0.74s (± 0.66%) +0.00s (+ 0.13%) 0.73s 0.75s
Check Time 5.84s (± 0.38%) 5.83s (± 0.46%) -0.01s (- 0.17%) 5.77s 5.88s
Emit Time 3.32s (± 0.68%) 3.28s (± 0.75%) -0.04s (- 1.18%) 3.22s 3.32s
Total Time 11.48s (± 0.45%) 11.45s (± 0.27%) -0.04s (- 0.31%) 11.38s 11.51s
TFS - node (v12.1.0, x64)
Memory used 289,711k (± 0.06%) 289,859k (± 0.02%) +148k (+ 0.05%) 289,715k 290,038k
Parse Time 1.30s (± 0.91%) 1.31s (± 0.62%) +0.01s (+ 0.84%) 1.30s 1.33s
Bind Time 0.72s (± 0.83%) 0.72s (± 0.86%) +0.00s (+ 0.42%) 0.71s 0.73s
Check Time 5.41s (± 0.66%) 5.39s (± 0.53%) -0.02s (- 0.35%) 5.35s 5.46s
Emit Time 3.55s (± 0.83%) 3.47s (± 1.17%) -0.07s (- 2.11%) 3.36s 3.55s
Total Time 10.98s (± 0.49%) 10.89s (± 0.60%) -0.09s (- 0.78%) 10.77s 11.05s
material-ui - node (v12.1.0, x64)
Memory used 448,714k (± 0.01%) 448,314k (± 0.09%) -400k (- 0.09%) 447,326k 448,763k
Parse Time 1.83s (± 0.79%) 1.84s (± 0.55%) +0.01s (+ 0.33%) 1.81s 1.86s
Bind Time 0.67s (± 0.86%) 0.67s (± 0.54%) +0.00s (+ 0.15%) 0.67s 0.68s
Check Time 13.16s (± 1.08%) 13.22s (± 0.50%) +0.06s (+ 0.45%) 13.09s 13.40s
Emit Time 0.00s (± 0.00%) 0.00s (± 0.00%) 0.00s ( NaN%) 0.00s 0.00s
Total Time 15.66s (± 0.98%) 15.73s (± 0.43%) +0.07s (+ 0.41%) 15.61s 15.91s
xstate - node (v12.1.0, x64)
Memory used 544,194k (± 0.02%) 544,273k (± 0.01%) +79k (+ 0.01%) 544,110k 544,407k
Parse Time 2.56s (± 0.51%) 2.55s (± 0.39%) -0.00s (- 0.08%) 2.53s 2.57s
Bind Time 1.04s (± 1.17%) 1.03s (± 0.92%) -0.01s (- 0.48%) 1.01s 1.05s
Check Time 1.51s (± 0.64%) 1.51s (± 0.38%) +0.00s (+ 0.13%) 1.50s 1.53s
Emit Time 0.07s (± 0.00%) 0.07s (± 0.00%) 0.00s ( 0.00%) 0.07s 0.07s
Total Time 5.18s (± 0.38%) 5.17s (± 0.41%) -0.01s (- 0.17%) 5.13s 5.23s
Angular - node (v14.15.1, x64)
Memory used 336,308k (± 0.01%) 336,385k (± 0.01%) +77k (+ 0.02%) 336,302k 336,439k
Parse Time 2.08s (± 0.85%) 2.09s (± 0.82%) +0.01s (+ 0.67%) 2.06s 2.13s
Bind Time 0.90s (± 0.58%) 0.90s (± 0.66%) -0.00s (- 0.33%) 0.88s 0.91s
Check Time 5.86s (± 0.42%) 5.88s (± 0.29%) +0.02s (+ 0.29%) 5.84s 5.91s
Emit Time 6.39s (± 0.45%) 6.20s (± 0.72%) 🟩-0.19s (- 3.04%) 6.12s 6.34s
Total Time 15.22s (± 0.18%) 15.06s (± 0.47%) -0.17s (- 1.08%) 14.92s 15.27s
Compiler-Unions - node (v14.15.1, x64)
Memory used 191,807k (± 0.01%) 192,001k (± 0.01%) +194k (+ 0.10%) 191,942k 192,057k
Parse Time 0.86s (± 0.58%) 0.86s (± 0.43%) +0.00s (+ 0.00%) 0.85s 0.86s
Bind Time 0.58s (± 0.51%) 0.58s (± 0.69%) +0.00s (+ 0.17%) 0.57s 0.59s
Check Time 6.71s (± 0.70%) 6.72s (± 0.53%) +0.02s (+ 0.25%) 6.64s 6.79s
Emit Time 2.50s (± 0.87%) 2.42s (± 0.64%) 🟩-0.08s (- 3.36%) 2.39s 2.45s
Total Time 10.64s (± 0.57%) 10.58s (± 0.36%) -0.06s (- 0.60%) 10.50s 10.66s
Monaco - node (v14.15.1, x64)
Memory used 325,767k (± 0.00%) 325,890k (± 0.01%) +123k (+ 0.04%) 325,859k 325,943k
Parse Time 1.58s (± 0.52%) 1.59s (± 0.80%) +0.01s (+ 0.57%) 1.57s 1.62s
Bind Time 0.78s (± 0.74%) 0.78s (± 0.43%) 0.00s ( 0.00%) 0.77s 0.79s
Check Time 5.74s (± 0.31%) 5.72s (± 0.61%) -0.02s (- 0.37%) 5.61s 5.80s
Emit Time 3.39s (± 0.68%) 3.35s (± 1.24%) -0.04s (- 1.33%) 3.28s 3.45s
Total Time 11.50s (± 0.19%) 11.44s (± 0.61%) -0.06s (- 0.52%) 11.26s 11.58s
TFS - node (v14.15.1, x64)
Memory used 288,895k (± 0.01%) 288,937k (± 0.01%) +42k (+ 0.01%) 288,888k 288,990k
Parse Time 1.32s (± 1.37%) 1.36s (± 2.41%) +0.04s (+ 3.27%) 1.29s 1.46s
Bind Time 0.79s (± 4.56%) 0.75s (± 2.74%) 🟩-0.04s (- 4.45%) 0.73s 0.81s
Check Time 5.37s (± 0.41%) 5.38s (± 0.24%) +0.01s (+ 0.09%) 5.35s 5.41s
Emit Time 3.61s (± 2.11%) 3.55s (± 1.68%) -0.06s (- 1.69%) 3.39s 3.63s
Total Time 11.08s (± 0.87%) 11.03s (± 0.67%) -0.05s (- 0.45%) 10.86s 11.18s
material-ui - node (v14.15.1, x64)
Memory used 446,647k (± 0.08%) 446,935k (± 0.00%) +288k (+ 0.06%) 446,881k 446,972k
Parse Time 1.89s (± 0.60%) 1.89s (± 0.32%) -0.00s (- 0.11%) 1.88s 1.90s
Bind Time 0.72s (± 0.97%) 0.72s (± 0.83%) +0.01s (+ 0.83%) 0.71s 0.74s
Check Time 13.30s (± 0.99%) 13.20s (± 0.66%) -0.09s (- 0.69%) 13.03s 13.44s
Emit Time 0.00s (± 0.00%) 0.00s (± 0.00%) 0.00s ( NaN%) 0.00s 0.00s
Total Time 15.90s (± 0.84%) 15.82s (± 0.55%) -0.09s (- 0.53%) 15.64s 16.04s
xstate - node (v14.15.1, x64)
Memory used 542,004k (± 0.00%) 542,157k (± 0.00%) +153k (+ 0.03%) 542,106k 542,194k
Parse Time 2.61s (± 0.34%) 2.62s (± 0.43%) +0.01s (+ 0.31%) 2.60s 2.65s
Bind Time 1.16s (± 0.99%) 1.17s (± 1.17%) +0.01s (+ 0.69%) 1.14s 1.20s
Check Time 1.56s (± 0.81%) 1.56s (± 0.75%) +0.00s (+ 0.06%) 1.53s 1.58s
Emit Time 0.07s (± 3.14%) 0.07s (± 4.92%) +0.00s (+ 4.23%) 0.07s 0.08s
Total Time 5.40s (± 0.48%) 5.42s (± 0.38%) +0.02s (+ 0.30%) 5.36s 5.46s
System
Machine Namets-ci-ubuntu
Platformlinux 4.4.0-210-generic
Architecturex64
Available Memory16 GB
Available Memory15 GB
CPUs4 × Intel(R) Core(TM) i7-4770 CPU @ 3.40GHz
Hosts
  • node (v10.16.3, x64)
  • node (v12.1.0, x64)
  • node (v14.15.1, x64)
Scenarios
  • Angular - node (v10.16.3, x64)
  • Angular - node (v12.1.0, x64)
  • Angular - node (v14.15.1, x64)
  • Compiler-Unions - node (v10.16.3, x64)
  • Compiler-Unions - node (v12.1.0, x64)
  • Compiler-Unions - node (v14.15.1, x64)
  • Monaco - node (v10.16.3, x64)
  • Monaco - node (v12.1.0, x64)
  • Monaco - node (v14.15.1, x64)
  • TFS - node (v10.16.3, x64)
  • TFS - node (v12.1.0, x64)
  • TFS - node (v14.15.1, x64)
  • material-ui - node (v10.16.3, x64)
  • material-ui - node (v12.1.0, x64)
  • material-ui - node (v14.15.1, x64)
  • xstate - node (v10.16.3, x64)
  • xstate - node (v12.1.0, x64)
  • xstate - node (v14.15.1, x64)
Benchmark Name Iterations
Current 50266 10
Baseline main 10

TSServer

Comparison Report - main..50266
Metric main 50266 Delta Best Worst
Compiler-UnionsTSServer - node (v10.16.3, x64)
Req 1 - updateOpen 1,464ms (± 0.67%) 1,467ms (± 0.63%) +3ms (+ 0.19%) 1,452ms 1,488ms
Req 2 - geterr 3,644ms (± 0.77%) 3,642ms (± 0.23%) -2ms (- 0.06%) 3,623ms 3,664ms
Req 3 - references 278ms (± 0.58%) 277ms (± 0.59%) -2ms (- 0.58%) 274ms 281ms
Req 4 - navto 232ms (± 0.82%) 235ms (± 0.96%) +3ms (+ 1.34%) 230ms 242ms
Req 5 - completionInfo count 1,355 (± 0.00%) 1,355 (± 0.00%) 0 ( 0.00%) 1,355 1,355
Req 5 - completionInfo 62ms (± 4.25%) 64ms (± 4.25%) +2ms (+ 2.58%) 59ms 70ms
CompilerTSServer - node (v10.16.3, x64)
Req 1 - updateOpen 1,565ms (± 0.48%) 1,566ms (± 0.49%) +1ms (+ 0.06%) 1,553ms 1,583ms
Req 2 - geterr 2,280ms (± 0.31%) 2,282ms (± 0.34%) +3ms (+ 0.11%) 2,267ms 2,300ms
Req 3 - references 300ms (± 1.07%) 298ms (± 0.83%) -2ms (- 0.63%) 292ms 302ms
Req 4 - navto 233ms (± 2.09%) 241ms (± 1.61%) +7ms (+ 3.08%) 229ms 246ms
Req 5 - completionInfo count 1,517 (± 0.00%) 1,517 (± 0.00%) 0 ( 0.00%) 1,517 1,517
Req 5 - completionInfo 68ms (± 3.08%) 69ms (± 1.22%) +1ms (+ 0.88%) 67ms 71ms
xstateTSServer - node (v10.16.3, x64)
Req 1 - updateOpen 2,183ms (± 0.42%) 2,188ms (± 0.51%) +5ms (+ 0.24%) 2,160ms 2,210ms
Req 2 - geterr 780ms (± 0.51%) 777ms (± 0.85%) -3ms (- 0.36%) 763ms 791ms
Req 3 - references 96ms (± 0.79%) 97ms (± 0.92%) +0ms (+ 0.21%) 95ms 98ms
Req 4 - navto 255ms (± 0.80%) 256ms (± 1.13%) +1ms (+ 0.43%) 250ms 263ms
Req 5 - completionInfo count 3,244 (± 0.00%) 3,244 (± 0.00%) 0 ( 0.00%) 3,244 3,244
Req 5 - completionInfo 274ms (± 1.06%) 275ms (± 0.72%) +1ms (+ 0.40%) 270ms 278ms
Compiler-UnionsTSServer - node (v12.1.0, x64)
Req 1 - updateOpen 1,485ms (± 0.68%) 1,491ms (± 0.80%) +6ms (+ 0.41%) 1,470ms 1,521ms
Req 2 - geterr 3,410ms (± 0.60%) 3,405ms (± 0.88%) -6ms (- 0.16%) 3,345ms 3,468ms
Req 3 - references 265ms (± 0.74%) 262ms (± 0.90%) -2ms (- 0.87%) 258ms 269ms
Req 4 - navto 204ms (± 1.06%) 206ms (± 1.19%) +2ms (+ 0.83%) 201ms 210ms
Req 5 - completionInfo count 1,355 (± 0.00%) 1,355 (± 0.00%) 0 ( 0.00%) 1,355 1,355
Req 5 - completionInfo 80ms (± 7.95%) 87ms (± 4.49%) +7ms (+ 8.59%) 80ms 95ms
CompilerTSServer - node (v12.1.0, x64)
Req 1 - updateOpen 1,574ms (± 0.43%) 1,587ms (± 0.64%) +13ms (+ 0.82%) 1,571ms 1,614ms
Req 2 - geterr 2,225ms (± 0.49%) 2,231ms (± 0.53%) +7ms (+ 0.30%) 2,212ms 2,263ms
Req 3 - references 274ms (± 0.65%) 275ms (± 1.14%) +1ms (+ 0.33%) 269ms 282ms
Req 4 - navto 215ms (± 1.04%) 216ms (± 1.06%) +1ms (+ 0.56%) 211ms 221ms
Req 5 - completionInfo count 1,517 (± 0.00%) 1,517 (± 0.00%) 0 ( 0.00%) 1,517 1,517
Req 5 - completionInfo 64ms (± 4.58%) 64ms (± 3.63%) -0ms (- 0.31%) 58ms 67ms
xstateTSServer - node (v12.1.0, x64)
Req 1 - updateOpen 2,109ms (± 0.65%) 2,115ms (± 0.70%) +7ms (+ 0.32%) 2,084ms 2,142ms
Req 2 - geterr 766ms (± 0.62%) 763ms (± 0.78%) -3ms (- 0.38%) 747ms 771ms
Req 3 - references 65ms (± 2.04%) 67ms (± 1.34%) +2ms (+ 2.31%) 65ms 69ms
Req 4 - navto 242ms (± 1.19%) 243ms (± 0.74%) +1ms (+ 0.41%) 239ms 246ms
Req 5 - completionInfo count 3,244 (± 0.00%) 3,244 (± 0.00%) 0 ( 0.00%) 3,244 3,244
Req 5 - completionInfo 266ms (± 1.33%) 266ms (± 0.92%) 0ms ( 0.00%) 261ms 271ms
Compiler-UnionsTSServer - node (v14.15.1, x64)
Req 1 - updateOpen 1,536ms (± 0.55%) 1,541ms (± 0.50%) +5ms (+ 0.30%) 1,521ms 1,561ms
Req 2 - geterr 3,566ms (± 0.48%) 3,561ms (± 0.56%) -5ms (- 0.13%) 3,518ms 3,607ms
Req 3 - references 279ms (± 2.40%) 277ms (± 0.78%) -2ms (- 0.61%) 273ms 281ms
Req 4 - navto 219ms (± 0.81%) 221ms (± 0.81%) +2ms (+ 0.87%) 217ms 226ms
Req 5 - completionInfo count 1,355 (± 0.00%) 1,355 (± 0.00%) 0 ( 0.00%) 1,355 1,355
Req 5 - completionInfo 58ms (± 5.16%) 58ms (± 5.13%) 0ms ( 0.00%) 55ms 66ms
CompilerTSServer - node (v14.15.1, x64)
Req 1 - updateOpen 1,612ms (± 0.68%) 1,609ms (± 0.51%) -2ms (- 0.15%) 1,588ms 1,627ms
Req 2 - geterr 2,359ms (± 0.42%) 2,346ms (± 0.38%) -13ms (- 0.56%) 2,325ms 2,363ms
Req 3 - references 289ms (± 0.96%) 288ms (± 0.61%) -1ms (- 0.38%) 284ms 291ms
Req 4 - navto 231ms (± 0.75%) 233ms (± 2.06%) +2ms (+ 1.04%) 227ms 246ms
Req 5 - completionInfo count 1,517 (± 0.00%) 1,517 (± 0.00%) 0 ( 0.00%) 1,517 1,517
Req 5 - completionInfo 53ms (± 0.89%) 53ms (± 0.84%) -1ms (- 0.94%) 52ms 54ms
xstateTSServer - node (v14.15.1, x64)
Req 1 - updateOpen 2,223ms (± 0.46%) 2,240ms (± 0.47%) +17ms (+ 0.78%) 2,224ms 2,266ms
Req 2 - geterr 782ms (± 0.39%) 783ms (± 0.41%) +0ms (+ 0.03%) 775ms 787ms
Req 3 - references 65ms (± 0.93%) 65ms (± 0.80%) +1ms (+ 0.93%) 64ms 66ms
Req 4 - navto 252ms (± 0.69%) 252ms (± 0.84%) +0ms (+ 0.04%) 247ms 256ms
Req 5 - completionInfo count 3,244 (± 0.00%) 3,244 (± 0.00%) 0 ( 0.00%) 3,244 3,244
Req 5 - completionInfo 268ms (± 0.39%) 269ms (± 0.71%) +1ms (+ 0.19%) 265ms 274ms
System
Machine Namets-ci-ubuntu
Platformlinux 4.4.0-210-generic
Architecturex64
Available Memory16 GB
Available Memory15 GB
CPUs4 × Intel(R) Core(TM) i7-4770 CPU @ 3.40GHz
Hosts
  • node (v10.16.3, x64)
  • node (v12.1.0, x64)
  • node (v14.15.1, x64)
Scenarios
  • Compiler-UnionsTSServer - node (v10.16.3, x64)
  • Compiler-UnionsTSServer - node (v12.1.0, x64)
  • Compiler-UnionsTSServer - node (v14.15.1, x64)
  • CompilerTSServer - node (v10.16.3, x64)
  • CompilerTSServer - node (v12.1.0, x64)
  • CompilerTSServer - node (v14.15.1, x64)
  • xstateTSServer - node (v10.16.3, x64)
  • xstateTSServer - node (v12.1.0, x64)
  • xstateTSServer - node (v14.15.1, x64)
Benchmark Name Iterations
Current 50266 10
Baseline main 10

Developer Information:

Download Benchmark

@@ -885,6 +885,144 @@ namespace ts {
/* @internal */ jsDocCache?: readonly JSDocTag[]; // Cache for getJSDocTags
}

/* @internal */
export type HasChildren =
Copy link
Member

Choose a reason for hiding this comment

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

I assume that if we need to update this, we'll know because some other code won't be able to compile?

Copy link
Member Author

Choose a reason for hiding this comment

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

To add a method to visitEachChild (and potentially forEachChild), we'd have to add the node to this union.

// Names

case SyntaxKind.Identifier:
Debug.type<Identifier>(node);
Copy link
Member

Choose a reason for hiding this comment

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

This is maybe a silly question, but are we sure the perf boost here isn't only because the new code never calls Debug.type?

Copy link
Member Author

Choose a reason for hiding this comment

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

Debug.type() had almost no impact on perf when I added it. It's a noop, so inlining pretty much results in elimination. It definitely wouldn't account for a 3% difference in emit time.

Copy link
Member

Choose a reason for hiding this comment

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

Fair enough, just checking!

@@ -885,6 +885,144 @@ namespace ts {
/* @internal */ jsDocCache?: readonly JSDocTag[]; // Cache for getJSDocTags
}

/* @internal */
export type HasChildren =
Copy link
Member

Choose a reason for hiding this comment

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

What happens if someone adds a new syntax kind and forgets to update this? Seems like their new node might not emit its children?

Copy link
Member

Choose a reason for hiding this comment

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

AFAIK that's what would have happened in the old code too, because it'd hit the default case to just do nothing.

Copy link
Member Author

Choose a reason for hiding this comment

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

If both this and #50225 use HasChildren, then you wouldn't be able to define a forEachChild branch or visitEachChild branch without adding an entry, and if you add an entry to HasChildren you would have compile time errors if you forget to add branches to forEachChild and visitEachChild.

@rbuckton
Copy link
Member Author

One more perf test to see if it's worth dropping the early check for tokens in visitEachChild.
@typescript-bot perf test

@typescript-bot
Copy link
Collaborator

typescript-bot commented Aug 11, 2022

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

Update: The results are in!

@@ -378,929 +378,799 @@ namespace ts {
export function visitEachChild<T extends Node>(node: T | undefined, visitor: Visitor, context: TransformationContext, nodesVisitor?: typeof visitNodes, tokenVisitor?: Visitor): T | undefined;
/* @internal */
export function visitEachChild<T extends Node>(node: T | undefined, visitor: Visitor, context: TransformationContext, nodesVisitor?: NodesVisitor, tokenVisitor?: Visitor, nodeVisitor?: NodeVisitor): T | undefined; // eslint-disable-line @typescript-eslint/unified-signatures
export function visitEachChild(node: Node | undefined, visitor: Visitor, context: TransformationContext, nodesVisitor = visitNodes, tokenVisitor?: Visitor, nodeVisitor: NodeVisitor = visitNode): Node | undefined {
export function visitEachChild<T extends Node>(node: T | undefined, visitor: Visitor, context: TransformationContext, nodesVisitor = visitNodes, tokenVisitor?: Visitor, nodeVisitor: NodeVisitor = visitNode): T | undefined {
Copy link
Member

Choose a reason for hiding this comment

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

Isn't the input possibly unrelated to the output? @jakebailey noticed something like this while converting to SFT.

Copy link
Member

@jakebailey jakebailey Aug 11, 2022

Choose a reason for hiding this comment

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

It totally is. In this case, the implementation fails under SFT because it doesn't overlap with its overloads, except that we don't properly check that without SFT which is why this weird narrower implementation works.

Changing the signature to match the overload is totally fine; no worse than what we have now and users won't see the difference. Actual SFT support and a corrected signature will have to come later when we're ready for a break.

Copy link
Member Author

Choose a reason for hiding this comment

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

I'm asserting visitEachChildTable[node.kind] as VisitEachChildFunction<T> | undefined. It's difficult to prove this in the type system, but VisitEachChildTable[T["kind"]] should be VisitEachChildFunction<T> | undefined. This isn't perfect, but its better than any.

Copy link
Member Author

Choose a reason for hiding this comment

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

We also don't have a great way of expressing the existing overloads in the type system. visitEachChild<BinaryExpressionButWithExtraTypeInfo>(...) would say it produces a BinaryExpressionButWithExtraTypeInfo, but would actually produce a BinaryExpressionButWithExtraTypeInfo | BinaryExpression depending on whether we updated the node. Unless we introduce a big ADT union of all possible Node subtypes, I don't think this can be improved.

Copy link
Member

Choose a reason for hiding this comment

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

Hm, unless I'm mistaken, the transform API is used heavily to completely and entirely replace nodes when visiting with... whatever, even nodes of differing types. So, I would expect that a fixed signature would instead have an overload with a more specific return first, but also a more generic "it's just a node" when the result can't be inferred.

But, that's offtopic.

Copy link
Member Author

Choose a reason for hiding this comment

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

visitEachChild always returns the same type of node passed as the first argument. You can only update child nodes using the supplied visitor.

Copy link
Member

Choose a reason for hiding this comment

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

Ah, oops, I think Daniel and I are thinking of visitNode and visitNodes, which do have a bogus signature.

Copy link
Member Author

@rbuckton rbuckton Aug 11, 2022

Choose a reason for hiding this comment

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

It is and it isn't. visitNode is really supposed to be used with a test parameter, such that you validate the result is a T when visiting a class of nodes such as Statement, Expression, etc. The test is optional, but really shouldn't be. Unfortunately, making test a required argument would probably be a breaking change, and we'd have to expose some of the higher-level node tests (i.e., isStatement, isExpression, isClassElement, etc.) in the public API that are currently internal.

@typescript-bot
Copy link
Collaborator

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

Here they are:

Compiler

Comparison Report - main..50266
Metric main 50266 Delta Best Worst
Angular - node (v10.16.3, x64)
Memory used 360,644k (± 0.02%) 360,874k (± 0.02%) +230k (+ 0.06%) 360,753k 361,089k
Parse Time 2.11s (± 0.42%) 2.11s (± 0.60%) -0.01s (- 0.47%) 2.08s 2.14s
Bind Time 0.89s (± 0.79%) 0.90s (± 0.74%) +0.01s (+ 1.01%) 0.88s 0.91s
Check Time 6.05s (± 0.66%) 6.05s (± 0.65%) +0.00s (+ 0.00%) 5.98s 6.13s
Emit Time 6.19s (± 0.86%) 6.00s (± 1.05%) 🟩-0.19s (- 3.02%) 5.89s 6.16s
Total Time 15.24s (± 0.62%) 15.05s (± 0.70%) -0.19s (- 1.23%) 14.87s 15.29s
Compiler-Unions - node (v10.16.3, x64)
Memory used 205,589k (± 0.04%) 205,821k (± 0.02%) +232k (+ 0.11%) 205,716k 205,926k
Parse Time 0.84s (± 0.71%) 0.84s (± 0.92%) +0.01s (+ 0.60%) 0.82s 0.86s
Bind Time 0.53s (± 1.27%) 0.52s (± 1.13%) -0.00s (- 0.57%) 0.51s 0.54s
Check Time 7.11s (± 0.48%) 7.12s (± 0.64%) +0.01s (+ 0.17%) 6.96s 7.19s
Emit Time 2.54s (± 1.22%) 2.44s (± 1.04%) 🟩-0.10s (- 3.86%) 2.39s 2.49s
Total Time 11.02s (± 0.54%) 10.93s (± 0.67%) -0.08s (- 0.77%) 10.70s 11.02s
Monaco - node (v10.16.3, x64)
Memory used 344,025k (± 0.02%) 344,190k (± 0.02%) +165k (+ 0.05%) 344,099k 344,358k
Parse Time 1.61s (± 0.67%) 1.61s (± 0.75%) +0.01s (+ 0.31%) 1.58s 1.64s
Bind Time 0.76s (± 0.66%) 0.76s (± 1.32%) +0.01s (+ 1.19%) 0.75s 0.80s
Check Time 6.02s (± 0.49%) 6.03s (± 0.38%) +0.01s (+ 0.10%) 5.98s 6.07s
Emit Time 3.28s (± 0.82%) 3.24s (± 0.73%) -0.04s (- 1.34%) 3.20s 3.30s
Total Time 11.67s (± 0.43%) 11.64s (± 0.26%) -0.03s (- 0.24%) 11.55s 11.69s
TFS - node (v10.16.3, x64)
Memory used 305,302k (± 0.02%) 305,332k (± 0.02%) +30k (+ 0.01%) 305,182k 305,429k
Parse Time 1.29s (± 0.31%) 1.30s (± 0.64%) +0.01s (+ 0.47%) 1.28s 1.32s
Bind Time 0.72s (± 0.80%) 0.73s (± 0.71%) +0.01s (+ 0.83%) 0.72s 0.74s
Check Time 5.46s (± 0.62%) 5.47s (± 0.38%) +0.01s (+ 0.15%) 5.44s 5.55s
Emit Time 3.44s (± 1.12%) 3.41s (± 1.35%) -0.03s (- 0.96%) 3.32s 3.49s
Total Time 10.92s (± 0.59%) 10.90s (± 0.57%) -0.02s (- 0.14%) 10.78s 11.07s
material-ui - node (v10.16.3, x64)
Memory used 469,637k (± 0.02%) 469,631k (± 0.01%) -6k (- 0.00%) 469,497k 469,766k
Parse Time 1.84s (± 0.83%) 1.84s (± 0.70%) -0.00s (- 0.22%) 1.81s 1.88s
Bind Time 0.69s (± 1.31%) 0.70s (± 1.33%) +0.01s (+ 1.01%) 0.67s 0.71s
Check Time 14.67s (± 0.41%) 14.73s (± 0.79%) +0.06s (+ 0.40%) 14.48s 15.09s
Emit Time 0.00s (± 0.00%) 0.00s (± 0.00%) 0.00s ( NaN%) 0.00s 0.00s
Total Time 17.21s (± 0.41%) 17.27s (± 0.72%) +0.06s (+ 0.35%) 16.99s 17.65s
xstate - node (v10.16.3, x64)
Memory used 578,910k (± 0.02%) 578,914k (± 0.01%) +4k (+ 0.00%) 578,807k 579,039k
Parse Time 2.61s (± 0.52%) 2.61s (± 0.48%) +0.00s (+ 0.11%) 2.58s 2.64s
Bind Time 1.05s (± 0.80%) 1.04s (± 1.06%) -0.01s (- 1.14%) 1.01s 1.06s
Check Time 1.58s (± 0.64%) 1.58s (± 0.52%) +0.01s (+ 0.57%) 1.56s 1.60s
Emit Time 0.07s (± 0.00%) 0.07s (± 0.00%) 0.00s ( 0.00%) 0.07s 0.07s
Total Time 5.30s (± 0.45%) 5.30s (± 0.25%) +0.00s (+ 0.09%) 5.26s 5.32s
Angular - node (v12.1.0, x64)
Memory used 338,061k (± 0.07%) 338,410k (± 0.03%) +349k (+ 0.10%) 338,263k 338,727k
Parse Time 2.10s (± 0.59%) 2.11s (± 1.08%) +0.00s (+ 0.19%) 2.06s 2.15s
Bind Time 0.86s (± 0.79%) 0.85s (± 0.96%) -0.01s (- 1.39%) 0.84s 0.87s
Check Time 5.87s (± 0.66%) 5.86s (± 0.38%) -0.00s (- 0.03%) 5.80s 5.91s
Emit Time 6.42s (± 0.89%) 6.21s (± 0.65%) 🟩-0.21s (- 3.32%) 6.10s 6.31s
Total Time 15.25s (± 0.40%) 15.03s (± 0.46%) -0.22s (- 1.48%) 14.86s 15.20s
Compiler-Unions - node (v12.1.0, x64)
Memory used 193,184k (± 0.08%) 193,416k (± 0.05%) +232k (+ 0.12%) 193,200k 193,619k
Parse Time 0.83s (± 0.70%) 0.83s (± 0.94%) +0.00s (+ 0.24%) 0.82s 0.85s
Bind Time 0.55s (± 0.40%) 0.55s (± 1.01%) +0.00s (+ 0.18%) 0.54s 0.57s
Check Time 6.64s (± 0.65%) 6.69s (± 0.53%) +0.05s (+ 0.72%) 6.60s 6.74s
Emit Time 2.52s (± 0.77%) 2.45s (± 0.73%) -0.07s (- 2.70%) 2.41s 2.49s
Total Time 10.54s (± 0.44%) 10.52s (± 0.37%) -0.02s (- 0.19%) 10.42s 10.58s
Monaco - node (v12.1.0, x64)
Memory used 326,962k (± 0.02%) 327,091k (± 0.02%) +129k (+ 0.04%) 326,858k 327,204k
Parse Time 1.57s (± 0.77%) 1.59s (± 0.76%) +0.01s (+ 0.70%) 1.55s 1.61s
Bind Time 0.74s (± 0.66%) 0.75s (± 0.60%) +0.00s (+ 0.54%) 0.74s 0.76s
Check Time 5.81s (± 0.50%) 5.84s (± 0.29%) +0.03s (+ 0.50%) 5.80s 5.89s
Emit Time 3.30s (± 0.81%) 3.31s (± 0.40%) +0.00s (+ 0.12%) 3.28s 3.34s
Total Time 11.43s (± 0.44%) 11.48s (± 0.32%) +0.05s (+ 0.47%) 11.41s 11.59s
TFS - node (v12.1.0, x64)
Memory used 289,855k (± 0.02%) 289,755k (± 0.07%) -99k (- 0.03%) 289,180k 289,969k
Parse Time 1.30s (± 1.13%) 1.31s (± 0.46%) +0.00s (+ 0.31%) 1.29s 1.32s
Bind Time 0.72s (± 0.77%) 0.72s (± 0.72%) -0.00s (- 0.42%) 0.71s 0.73s
Check Time 5.37s (± 0.51%) 5.37s (± 0.51%) +0.00s (+ 0.00%) 5.33s 5.43s
Emit Time 3.51s (± 0.72%) 3.53s (± 1.54%) +0.02s (+ 0.71%) 3.45s 3.72s
Total Time 10.90s (± 0.44%) 10.93s (± 0.66%) +0.03s (+ 0.27%) 10.82s 11.16s
material-ui - node (v12.1.0, x64)
Memory used 448,741k (± 0.02%) 448,586k (± 0.07%) -156k (- 0.03%) 447,431k 448,870k
Parse Time 1.82s (± 0.54%) 1.84s (± 0.58%) +0.02s (+ 1.04%) 1.82s 1.87s
Bind Time 0.68s (± 0.74%) 0.67s (± 0.74%) -0.00s (- 0.00%) 0.66s 0.68s
Check Time 13.13s (± 0.57%) 13.11s (± 0.85%) -0.02s (- 0.13%) 12.85s 13.28s
Emit Time 0.00s (± 0.00%) 0.00s (± 0.00%) 0.00s ( NaN%) 0.00s 0.00s
Total Time 15.62s (± 0.54%) 15.63s (± 0.76%) +0.00s (+ 0.03%) 15.34s 15.83s
xstate - node (v12.1.0, x64)
Memory used 544,241k (± 0.01%) 544,352k (± 0.02%) +110k (+ 0.02%) 544,177k 544,603k
Parse Time 2.53s (± 0.59%) 2.55s (± 0.32%) +0.01s (+ 0.51%) 2.53s 2.57s
Bind Time 1.04s (± 0.66%) 1.04s (± 1.03%) +0.01s (+ 0.58%) 1.02s 1.07s
Check Time 1.51s (± 0.39%) 1.52s (± 0.49%) +0.01s (+ 0.73%) 1.50s 1.53s
Emit Time 0.07s (± 0.00%) 0.07s (± 0.00%) 0.00s ( 0.00%) 0.07s 0.07s
Total Time 5.15s (± 0.41%) 5.17s (± 0.28%) +0.03s (+ 0.50%) 5.15s 5.22s
Angular - node (v14.15.1, x64)
Memory used 336,429k (± 0.01%) 336,523k (± 0.01%) +94k (+ 0.03%) 336,432k 336,565k
Parse Time 2.07s (± 0.59%) 2.07s (± 0.60%) -0.00s (- 0.19%) 2.04s 2.09s
Bind Time 0.90s (± 0.62%) 0.90s (± 0.58%) +0.00s (+ 0.33%) 0.89s 0.91s
Check Time 5.83s (± 0.36%) 5.85s (± 0.61%) +0.02s (+ 0.29%) 5.78s 5.94s
Emit Time 6.39s (± 0.83%) 6.19s (± 0.66%) 🟩-0.20s (- 3.10%) 6.12s 6.29s
Total Time 15.19s (± 0.44%) 15.01s (± 0.33%) -0.18s (- 1.16%) 14.95s 15.18s
Compiler-Unions - node (v14.15.1, x64)
Memory used 191,831k (± 0.02%) 192,024k (± 0.02%) +193k (+ 0.10%) 191,916k 192,088k
Parse Time 0.86s (± 0.82%) 0.86s (± 0.78%) -0.00s (- 0.23%) 0.84s 0.87s
Bind Time 0.58s (± 0.63%) 0.58s (± 0.69%) +0.00s (+ 0.52%) 0.57s 0.59s
Check Time 6.71s (± 0.70%) 6.71s (± 0.90%) +0.01s (+ 0.09%) 6.56s 6.83s
Emit Time 2.50s (± 1.33%) 2.42s (± 0.70%) 🟩-0.08s (- 3.24%) 2.39s 2.47s
Total Time 10.64s (± 0.64%) 10.56s (± 0.63%) -0.07s (- 0.68%) 10.37s 10.67s
Monaco - node (v14.15.1, x64)
Memory used 325,760k (± 0.01%) 325,915k (± 0.01%) +155k (+ 0.05%) 325,874k 325,958k
Parse Time 1.59s (± 0.74%) 1.58s (± 0.35%) -0.01s (- 0.44%) 1.57s 1.59s
Bind Time 0.78s (± 0.67%) 0.78s (± 0.29%) +0.00s (+ 0.26%) 0.78s 0.79s
Check Time 5.71s (± 0.46%) 5.73s (± 0.34%) +0.02s (+ 0.30%) 5.67s 5.77s
Emit Time 3.36s (± 0.88%) 3.36s (± 0.84%) -0.01s (- 0.21%) 3.32s 3.43s
Total Time 11.44s (± 0.34%) 11.45s (± 0.32%) +0.01s (+ 0.07%) 11.38s 11.53s
TFS - node (v14.15.1, x64)
Memory used 288,895k (± 0.01%) 288,963k (± 0.00%) +68k (+ 0.02%) 288,935k 289,002k
Parse Time 1.34s (± 1.24%) 1.35s (± 2.15%) +0.01s (+ 0.75%) 1.29s 1.42s
Bind Time 0.74s (± 3.66%) 0.76s (± 3.99%) +0.02s (+ 2.02%) 0.73s 0.86s
Check Time 5.37s (± 0.42%) 5.43s (± 0.42%) +0.06s (+ 1.10%) 5.39s 5.48s
Emit Time 3.54s (± 1.71%) 3.59s (± 2.01%) +0.05s (+ 1.27%) 3.42s 3.69s
Total Time 10.99s (± 0.67%) 11.12s (± 0.75%) +0.13s (+ 1.17%) 10.87s 11.27s
material-ui - node (v14.15.1, x64)
Memory used 446,756k (± 0.07%) 446,928k (± 0.00%) +172k (+ 0.04%) 446,895k 446,980k
Parse Time 1.88s (± 0.39%) 1.89s (± 0.61%) +0.01s (+ 0.48%) 1.86s 1.90s
Bind Time 0.72s (± 0.86%) 0.72s (± 0.94%) +0.01s (+ 0.70%) 0.71s 0.74s
Check Time 13.24s (± 0.80%) 13.25s (± 0.73%) +0.01s (+ 0.08%) 13.03s 13.43s
Emit Time 0.00s (± 0.00%) 0.00s (± 0.00%) 0.00s ( NaN%) 0.00s 0.00s
Total Time 15.84s (± 0.69%) 15.86s (± 0.64%) +0.02s (+ 0.14%) 15.65s 16.05s
xstate - node (v14.15.1, x64)
Memory used 541,995k (± 0.01%) 542,160k (± 0.00%) +165k (+ 0.03%) 542,124k 542,210k
Parse Time 2.60s (± 0.49%) 2.60s (± 0.36%) +0.00s (+ 0.08%) 2.58s 2.62s
Bind Time 1.16s (± 0.97%) 1.16s (± 1.17%) +0.00s (+ 0.26%) 1.14s 1.20s
Check Time 1.56s (± 0.61%) 1.57s (± 0.67%) +0.01s (+ 0.64%) 1.54s 1.59s
Emit Time 0.07s (± 3.14%) 0.07s (± 4.13%) +0.00s (+ 1.41%) 0.07s 0.08s
Total Time 5.38s (± 0.36%) 5.40s (± 0.29%) +0.02s (+ 0.35%) 5.37s 5.44s
System
Machine Namets-ci-ubuntu
Platformlinux 4.4.0-210-generic
Architecturex64
Available Memory16 GB
Available Memory15 GB
CPUs4 × Intel(R) Core(TM) i7-4770 CPU @ 3.40GHz
Hosts
  • node (v10.16.3, x64)
  • node (v12.1.0, x64)
  • node (v14.15.1, x64)
Scenarios
  • Angular - node (v10.16.3, x64)
  • Angular - node (v12.1.0, x64)
  • Angular - node (v14.15.1, x64)
  • Compiler-Unions - node (v10.16.3, x64)
  • Compiler-Unions - node (v12.1.0, x64)
  • Compiler-Unions - node (v14.15.1, x64)
  • Monaco - node (v10.16.3, x64)
  • Monaco - node (v12.1.0, x64)
  • Monaco - node (v14.15.1, x64)
  • TFS - node (v10.16.3, x64)
  • TFS - node (v12.1.0, x64)
  • TFS - node (v14.15.1, x64)
  • material-ui - node (v10.16.3, x64)
  • material-ui - node (v12.1.0, x64)
  • material-ui - node (v14.15.1, x64)
  • xstate - node (v10.16.3, x64)
  • xstate - node (v12.1.0, x64)
  • xstate - node (v14.15.1, x64)
Benchmark Name Iterations
Current 50266 10
Baseline main 10

TSServer

Comparison Report - main..50266
Metric main 50266 Delta Best Worst
Compiler-UnionsTSServer - node (v10.16.3, x64)
Req 1 - updateOpen 1,453ms (± 0.41%) 1,465ms (± 0.47%) +12ms (+ 0.81%) 1,452ms 1,479ms
Req 2 - geterr 3,624ms (± 0.58%) 3,658ms (± 0.47%) +33ms (+ 0.91%) 3,603ms 3,700ms
Req 3 - references 279ms (± 2.13%) 278ms (± 1.07%) -1ms (- 0.36%) 274ms 289ms
Req 4 - navto 232ms (± 0.91%) 233ms (± 0.43%) +1ms (+ 0.52%) 231ms 235ms
Req 5 - completionInfo count 1,355 (± 0.00%) 1,355 (± 0.00%) 0 ( 0.00%) 1,355 1,355
Req 5 - completionInfo 63ms (± 3.97%) 65ms (± 3.48%) +2ms (+ 2.86%) 61ms 69ms
CompilerTSServer - node (v10.16.3, x64)
Req 1 - updateOpen 1,558ms (± 0.48%) 1,556ms (± 0.43%) -2ms (- 0.11%) 1,537ms 1,568ms
Req 2 - geterr 2,279ms (± 0.42%) 2,277ms (± 0.69%) -2ms (- 0.09%) 2,243ms 2,312ms
Req 3 - references 305ms (± 1.47%) 298ms (± 0.77%) -8ms (- 2.52%) 290ms 301ms
Req 4 - navto 242ms (± 1.03%) 239ms (± 1.74%) -3ms (- 1.24%) 227ms 244ms
Req 5 - completionInfo count 1,517 (± 0.00%) 1,517 (± 0.00%) 0 ( 0.00%) 1,517 1,517
Req 5 - completionInfo 69ms (± 2.70%) 69ms (± 2.48%) 0ms ( 0.00%) 65ms 74ms
xstateTSServer - node (v10.16.3, x64)
Req 1 - updateOpen 2,177ms (± 0.43%) 2,181ms (± 0.34%) +4ms (+ 0.20%) 2,168ms 2,196ms
Req 2 - geterr 775ms (± 0.59%) 776ms (± 0.66%) +1ms (+ 0.15%) 760ms 785ms
Req 3 - references 98ms (± 1.89%) 96ms (± 0.90%) -2ms (- 2.24%) 94ms 98ms
Req 4 - navto 256ms (± 0.92%) 257ms (± 0.95%) +1ms (+ 0.43%) 251ms 262ms
Req 5 - completionInfo count 3,244 (± 0.00%) 3,244 (± 0.00%) 0 ( 0.00%) 3,244 3,244
Req 5 - completionInfo 272ms (± 1.91%) 274ms (± 1.25%) +2ms (+ 0.73%) 266ms 280ms
Compiler-UnionsTSServer - node (v12.1.0, x64)
Req 1 - updateOpen 1,484ms (± 0.66%) 1,483ms (± 0.73%) -1ms (- 0.07%) 1,455ms 1,508ms
Req 2 - geterr 3,397ms (± 0.78%) 3,405ms (± 0.81%) +9ms (+ 0.25%) 3,351ms 3,465ms
Req 3 - references 261ms (± 1.08%) 263ms (± 0.63%) +2ms (+ 0.92%) 260ms 267ms
Req 4 - navto 205ms (± 0.71%) 204ms (± 0.94%) -1ms (- 0.24%) 200ms 208ms
Req 5 - completionInfo count 1,355 (± 0.00%) 1,355 (± 0.00%) 0 ( 0.00%) 1,355 1,355
Req 5 - completionInfo 73ms (±15.81%) 87ms (± 5.66%) +14ms (+19.40%) 81ms 106ms
CompilerTSServer - node (v12.1.0, x64)
Req 1 - updateOpen 1,574ms (± 0.59%) 1,571ms (± 0.41%) -2ms (- 0.14%) 1,560ms 1,586ms
Req 2 - geterr 2,209ms (± 0.50%) 2,225ms (± 0.84%) +16ms (+ 0.73%) 2,191ms 2,268ms
Req 3 - references 273ms (± 0.71%) 273ms (± 1.23%) -0ms (- 0.15%) 267ms 283ms
Req 4 - navto 214ms (± 0.91%) 216ms (± 1.08%) +2ms (+ 1.08%) 213ms 223ms
Req 5 - completionInfo count 1,517 (± 0.00%) 1,517 (± 0.00%) 0 ( 0.00%) 1,517 1,517
Req 5 - completionInfo 63ms (± 3.63%) 63ms (± 3.27%) +0ms (+ 0.16%) 58ms 67ms
xstateTSServer - node (v12.1.0, x64)
Req 1 - updateOpen 2,094ms (± 0.19%) 2,116ms (± 0.66%) +21ms (+ 1.02%) 2,081ms 2,153ms
Req 2 - geterr 763ms (± 0.57%) 764ms (± 0.30%) +1ms (+ 0.07%) 760ms 770ms
Req 3 - references 66ms (± 1.46%) 67ms (± 1.67%) +1ms (+ 0.76%) 63ms 69ms
Req 4 - navto 241ms (± 1.46%) 244ms (± 0.83%) +4ms (+ 1.45%) 239ms 248ms
Req 5 - completionInfo count 3,244 (± 0.00%) 3,244 (± 0.00%) 0 ( 0.00%) 3,244 3,244
Req 5 - completionInfo 265ms (± 0.65%) 263ms (± 0.69%) -3ms (- 0.98%) 258ms 267ms
Compiler-UnionsTSServer - node (v14.15.1, x64)
Req 1 - updateOpen 1,527ms (± 0.25%) 1,532ms (± 0.50%) +5ms (+ 0.34%) 1,517ms 1,549ms
Req 2 - geterr 3,540ms (± 0.69%) 3,538ms (± 0.51%) -2ms (- 0.07%) 3,502ms 3,583ms
Req 3 - references 277ms (± 1.37%) 277ms (± 0.34%) -1ms (- 0.29%) 275ms 279ms
Req 4 - navto 218ms (± 0.73%) 217ms (± 0.59%) -1ms (- 0.32%) 215ms 220ms
Req 5 - completionInfo count 1,355 (± 0.00%) 1,355 (± 0.00%) 0 ( 0.00%) 1,355 1,355
Req 5 - completionInfo 55ms (± 0.73%) 58ms (± 6.06%) +3ms (+ 6.01%) 54ms 66ms
CompilerTSServer - node (v14.15.1, x64)
Req 1 - updateOpen 1,610ms (± 0.61%) 1,615ms (± 0.83%) +5ms (+ 0.32%) 1,588ms 1,652ms
Req 2 - geterr 2,347ms (± 0.61%) 2,339ms (± 0.40%) -8ms (- 0.34%) 2,325ms 2,371ms
Req 3 - references 288ms (± 1.14%) 289ms (± 0.89%) +0ms (+ 0.07%) 283ms 295ms
Req 4 - navto 229ms (± 0.81%) 232ms (± 1.96%) +3ms (+ 1.49%) 228ms 250ms
Req 5 - completionInfo count 1,517 (± 0.00%) 1,517 (± 0.00%) 0 ( 0.00%) 1,517 1,517
Req 5 - completionInfo 53ms (± 0.84%) 53ms (± 0.75%) +0ms (+ 0.57%) 52ms 54ms
xstateTSServer - node (v14.15.1, x64)
Req 1 - updateOpen 2,230ms (± 0.44%) 2,230ms (± 0.49%) -0ms (- 0.02%) 2,204ms 2,247ms
Req 2 - geterr 780ms (± 0.36%) 783ms (± 0.58%) +3ms (+ 0.41%) 773ms 793ms
Req 3 - references 64ms (± 0.90%) 65ms (± 0.90%) +1ms (+ 1.09%) 64ms 66ms
Req 4 - navto 249ms (± 0.91%) 250ms (± 0.95%) +1ms (+ 0.28%) 246ms 256ms
Req 5 - completionInfo count 3,244 (± 0.00%) 3,244 (± 0.00%) 0 ( 0.00%) 3,244 3,244
Req 5 - completionInfo 268ms (± 0.53%) 268ms (± 0.67%) +1ms (+ 0.22%) 264ms 272ms
System
Machine Namets-ci-ubuntu
Platformlinux 4.4.0-210-generic
Architecturex64
Available Memory16 GB
Available Memory15 GB
CPUs4 × Intel(R) Core(TM) i7-4770 CPU @ 3.40GHz
Hosts
  • node (v10.16.3, x64)
  • node (v12.1.0, x64)
  • node (v14.15.1, x64)
Scenarios
  • Compiler-UnionsTSServer - node (v10.16.3, x64)
  • Compiler-UnionsTSServer - node (v12.1.0, x64)
  • Compiler-UnionsTSServer - node (v14.15.1, x64)
  • CompilerTSServer - node (v10.16.3, x64)
  • CompilerTSServer - node (v12.1.0, x64)
  • CompilerTSServer - node (v14.15.1, x64)
  • xstateTSServer - node (v10.16.3, x64)
  • xstateTSServer - node (v12.1.0, x64)
  • xstateTSServer - node (v14.15.1, x64)
Benchmark Name Iterations
Current 50266 10
Baseline main 10

Developer Information:

Download Benchmark

@rbuckton
Copy link
Member Author

Have we decided on whether we prefer the Array or Object Literal variant for jump tables?

@jakebailey
Copy link
Member

Does the same type safety work for the array? My guess was not (especially if we are using push to keep the array compact)

@rbuckton
Copy link
Member Author

Does the same type safety work for the array? My guess was not (especially if we are using push to keep the array compact)

No, it doesn't. To do the same thing with an array would require using an array literal and packing it with leading undefined values for all the token nodes.

@jakebailey
Copy link
Member

For me, if the perf is the same, I'd prefer the safer one.

@DanielRosenwasser
Copy link
Member

Yeah, ultimately I didn't see enough of a win doing one over the other.

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

Successfully merging this pull request may close these issues.

6 participants