GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Swap closure state in the type-checker to `var` to avoid TDZ checks. by DanielRosenwasser · Pull Request #52835 · microsoft/TypeScript

Conversation

@DanielRosenwasser

@DanielRosenwasser Daniel Rosenwasser (DanielRosenwasser) commented Feb 18, 2023

Copy link
Copy Markdown
Member

Follow-up from #52832.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

SlurpTheo reacted with eyes emoji
All reactions
  • 👀 1 reaction
@DanielRosenwasser
Swap shared pre-initialized closure state in checker to var to avoi…
99368d9
…d TDZ checks.
@typescript-bot TypeScript Bot (typescript-bot) assigned Daniel Rosenwasser (DanielRosenwasser) Feb 18, 2023
@typescript-bot TypeScript Bot (typescript-bot) added Author: Team For Uncommitted Bug PR for untriaged, rejected, closed or missing bug labels Feb 18, 2023
@DanielRosenwasser

Daniel Rosenwasser (DanielRosenwasser) commented Feb 18, 2023

Copy link
Copy Markdown
Member Author

TypeScript Bot (@typescript-bot) perf test this faster

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@typescript-bot

TypeScript Bot (typescript-bot) commented Feb 18, 2023 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor

Heya Daniel Rosenwasser (@DanielRosenwasser), I've started to run the abridged perf test suite on this PR at 99368d9. You can monitor the build here.

Update: The results are in!

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@DanielRosenwasser Daniel Rosenwasser (DanielRosenwasser) changed the title Swap shared pre-initialized closure state in checker to var to avoid TDZ checks. Swap closure state in the type-checker to var to avoid TDZ checks. Feb 18, 2023
@typescript-bot

TypeScript Bot (typescript-bot) commented Feb 18, 2023

Copy link
Copy Markdown
Contributor

Daniel Rosenwasser (@DanielRosenwasser)
The results of the perf run you requested are in!

Here they are:

Comparison Report - main..52835

Metric main 52835 Delta Best Worst p-value
Angular - node (v16.17.1, x64)
Memory used 359,091k (± 0.01%) 358,659k (± 0.00%) -431k (- 0.12%) 358,642k 358,680k p=0.005 n=6
Parse Time 4.15s (± 0.28%) 3.72s (± 0.31%) 🟩-0.43s (-10.29%) 3.71s 3.74s p=0.005 n=6
Bind Time 1.24s (± 0.44%) 1.24s (± 1.11%) ~ 1.22s 1.25s p=1.000 n=6
Check Time 9.52s (± 0.18%) 9.41s (± 0.17%) -0.11s (- 1.12%) 9.39s 9.43s p=0.004 n=6
Emit Time 8.09s (± 0.38%) 8.13s (± 0.46%) ~ 8.06s 8.16s p=0.146 n=6
Total Time 22.99s (± 0.17%) 22.48s (± 0.30%) -0.50s (- 2.19%) 22.38s 22.56s p=0.005 n=6
Compiler-Unions - node (v16.17.1, x64)
Memory used 191,697k (± 0.02%) 191,365k (± 0.01%) -332k (- 0.17%) 191,346k 191,389k p=0.005 n=6
Parse Time 1.80s (± 1.09%) 1.56s (± 0.75%) 🟩-0.24s (-13.48%) 1.55s 1.58s p=0.005 n=6
Bind Time 0.84s (± 0.99%) 0.84s (± 0.48%) ~ 0.84s 0.85s p=0.527 n=6
Check Time 10.14s (± 0.33%) 10.00s (± 0.79%) -0.14s (- 1.40%) 9.93s 10.14s p=0.024 n=6
Emit Time 3.07s (± 0.86%) 3.05s (± 0.78%) ~ 3.02s 3.08s p=0.255 n=6
Total Time 15.85s (± 0.20%) 15.45s (± 0.50%) -0.41s (- 2.58%) 15.37s 15.57s p=0.005 n=6
Monaco - node (v16.17.1, x64)
Memory used 343,545k (± 0.01%) 343,123k (± 0.00%) -422k (- 0.12%) 343,110k 343,145k p=0.005 n=6
Parse Time 3.13s (± 1.11%) 2.80s (± 0.65%) 🟩-0.33s (-10.49%) 2.78s 2.83s p=0.005 n=6
Bind Time 1.12s (± 0.67%) 1.11s (± 0.57%) ~ 1.10s 1.12s p=0.081 n=6
Check Time 7.79s (± 0.40%) 7.70s (± 0.32%) -0.09s (- 1.18%) 7.66s 7.73s p=0.005 n=6
Emit Time 4.52s (± 0.67%) 4.55s (± 0.66%) ~ 4.50s 4.58s p=0.139 n=6
Total Time 16.55s (± 0.35%) 16.15s (± 0.24%) -0.40s (- 2.44%) 16.10s 16.19s p=0.005 n=6
TFS - node (v16.17.1, x64)
Memory used 299,648k (± 0.00%) 299,279k (± 0.00%) -369k (- 0.12%) 299,264k 299,303k p=0.005 n=6
Parse Time 2.45s (± 0.82%) 2.20s (± 0.85%) 🟩-0.25s (-10.34%) 2.18s 2.22s p=0.005 n=6
Bind Time 1.26s (± 0.41%) 1.25s (± 0.65%) ~ 1.24s 1.26s p=0.523 n=6
Check Time 7.21s (± 0.30%) 7.16s (± 0.54%) -0.05s (- 0.69%) 7.11s 7.21s p=0.036 n=6
Emit Time 4.20s (± 0.55%) 4.24s (± 0.85%) ~ 4.20s 4.30s p=0.107 n=6
Total Time 15.12s (± 0.19%) 14.85s (± 0.45%) -0.27s (- 1.79%) 14.77s 14.96s p=0.005 n=6
material-ui - node (v16.17.1, x64)
Memory used 475,970k (± 0.01%) 475,566k (± 0.00%) -405k (- 0.08%) 475,548k 475,608k p=0.005 n=6
Parse Time 3.68s (± 0.49%) 3.33s (± 0.40%) 🟩-0.35s (- 9.47%) 3.31s 3.35s p=0.005 n=6
Bind Time 1.02s (± 0.88%) 1.02s (± 0.40%) ~ 1.01s 1.02s p=0.787 n=6
Check Time 18.22s (± 0.48%) 18.06s (± 1.15%) ~ 17.91s 18.48s p=0.065 n=6
Emit Time 0.00s (± 0.00%) 0.00s (± 0.00%) ~ 0.00s 0.00s p=1.000 n=6
Total Time 22.92s (± 0.42%) 22.41s (± 0.94%) -0.51s (- 2.20%) 22.25s 22.83s p=0.008 n=6
xstate - node (v16.17.1, x64)
Memory used 546,954k (± 0.02%) 545,898k (± 0.01%) -1,056k (- 0.19%) 545,796k 545,992k p=0.005 n=6
Parse Time 4.77s (± 0.34%) 4.26s (± 0.35%) 🟩-0.51s (-10.66%) 4.24s 4.28s p=0.005 n=6
Bind Time 1.85s (± 0.68%) 1.81s (± 0.35%) -0.04s (- 2.16%) 1.80s 1.82s p=0.004 n=6
Check Time 3.07s (± 0.79%) 2.97s (± 0.56%) 🟩-0.10s (- 3.15%) 2.94s 2.99s p=0.005 n=6
Emit Time 0.09s (± 5.53%) 0.09s (± 4.45%) ~ 0.09s 0.10s p=0.595 n=6
Total Time 9.78s (± 0.17%) 9.13s (± 0.24%) 🟩-0.65s (- 6.68%) 9.10s 9.16s p=0.005 n=6
System
Machine Namets-ci-ubuntu
Platformlinux 5.4.0-135-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
  • Angular - node (v16.17.1, x64)
  • Compiler-Unions - node (v16.17.1, x64)
  • Monaco - node (v16.17.1, x64)
  • TFS - node (v16.17.1, x64)
  • material-ui - node (v16.17.1, x64)
  • xstate - node (v16.17.1, x64)
Benchmark Name Iterations
Current 52835 6
Baseline main 6

Developer Information:

Download Benchmark

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@jakebailey

Jake Bailey (jakebailey) commented Feb 18, 2023

Copy link
Copy Markdown
Member

It's sort of interesting that it's always 0.10ish seconds saved; is there a fixed window where this is problematic?

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@DanielRosenwasser

Daniel Rosenwasser (DanielRosenwasser) commented Feb 18, 2023

Copy link
Copy Markdown
Member Author

Ugh, probably conflating changes.

TypeScript Bot (@typescript-bot) perf test this

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@typescript-bot

TypeScript Bot (typescript-bot) commented Feb 18, 2023 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor

Heya Daniel Rosenwasser (@DanielRosenwasser), I've started to run the perf test suite on this PR at 99368d9. You can monitor the build here.

steveluscher reacted with eyes emoji
All reactions
  • 👀 1 reaction

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@DanielRosenwasser

Daniel Rosenwasser (DanielRosenwasser) commented Feb 18, 2023

Copy link
Copy Markdown
Member Author

GitHub has been 500'ing, so the perf run succeeded, but posting a comment didn't succeed.

Here are the results:

Compiler

Comparison Report - main..52835
Metric main 52835 Delta Best Worst p-value
Angular - node (v18.10.0, x64)
Memory used 359,387k (± 0.01%) 359,263k (± 0.01%) -124k (- 0.03%) 359,234k 359,307k p=0.005 n=6
Parse Time 3.50s (± 0.86%) 3.48s (± 0.95%) ~ 3.45s 3.52s p=0.371 n=6
Bind Time 1.17s (± 0.44%) 1.17s (± 0.64%) ~ 1.16s 1.18s p=0.784 n=6
Check Time 8.77s (± 0.62%) 8.66s (± 0.48%) -0.11s (- 1.27%) 8.63s 8.74s p=0.010 n=6
Emit Time 7.61s (± 0.92%) 7.59s (± 0.40%) ~ 7.56s 7.63s p=0.871 n=6
Total Time 21.05s (± 0.62%) 20.90s (± 0.33%) -0.15s (- 0.73%) 20.80s 21.01s p=0.037 n=6
Compiler-Unions - node (v18.10.0, x64)
Memory used 190,827k (± 1.19%) 190,766k (± 1.20%) ~ 189,782k 195,442k p=0.173 n=6
Parse Time 1.48s (± 0.66%) 1.49s (± 0.66%) ~ 1.48s 1.50s p=0.359 n=6
Bind Time 0.79s (± 0.52%) 0.79s (± 0.69%) ~ 0.79s 0.80s p=0.282 n=6
Check Time 9.42s (± 0.88%) 9.35s (± 0.43%) ~ 9.29s 9.41s p=0.199 n=6
Emit Time 2.82s (± 1.62%) 2.82s (± 0.86%) ~ 2.80s 2.86s p=0.872 n=6
Total Time 14.51s (± 0.77%) 14.46s (± 0.32%) ~ 14.42s 14.54s p=0.261 n=6
Monaco - node (v18.10.0, x64)
Memory used 343,979k (± 0.01%) 343,850k (± 0.01%) -128k (- 0.04%) 343,821k 343,896k p=0.005 n=6
Parse Time 2.62s (± 1.17%) 2.61s (± 1.05%) ~ 2.57s 2.65s p=0.420 n=6
Bind Time 1.03s (± 0.81%) 1.03s (± 1.18%) ~ 1.01s 1.04s p=0.753 n=6
Check Time 7.12s (± 0.44%) 7.04s (± 0.59%) -0.08s (- 1.12%) 6.99s 7.09s p=0.008 n=6
Emit Time 4.33s (± 0.35%) 4.32s (± 0.47%) ~ 4.29s 4.35s p=0.517 n=6
Total Time 15.10s (± 0.30%) 15.00s (± 0.45%) -0.10s (- 0.67%) 14.93s 15.12s p=0.030 n=6
TFS - node (v18.10.0, x64)
Memory used 300,028k (± 0.00%) 299,923k (± 0.01%) -104k (- 0.03%) 299,899k 299,969k p=0.005 n=6
Parse Time 2.07s (± 1.48%) 2.04s (± 0.80%) ~ 2.02s 2.06s p=0.126 n=6
Bind Time 1.17s (± 0.44%) 1.17s (± 0.64%) ~ 1.16s 1.18s p=0.784 n=6
Check Time 6.57s (± 0.30%) 6.48s (± 0.60%) -0.09s (- 1.42%) 6.43s 6.53s p=0.005 n=6
Emit Time 3.93s (± 0.66%) 3.91s (± 0.55%) ~ 3.88s 3.94s p=0.293 n=6
Total Time 13.75s (± 0.50%) 13.61s (± 0.31%) -0.14s (- 1.04%) 13.55s 13.65s p=0.016 n=6
material-ui - node (v18.10.0, x64)
Memory used 476,411k (± 0.01%) 476,287k (± 0.01%) -124k (- 0.03%) 476,250k 476,326k p=0.005 n=6
Parse Time 3.15s (± 1.09%) 3.15s (± 0.40%) ~ 3.13s 3.16s p=0.935 n=6
Bind Time 0.97s (± 0.42%) 0.96s (± 0.85%) ~ 0.95s 0.97s p=0.248 n=6
Check Time 17.18s (± 0.32%) 17.01s (± 0.53%) -0.17s (- 1.00%) 16.89s 17.11s p=0.006 n=6
Emit Time 0.00s (± 0.00%) 0.00s (± 0.00%) ~ 0.00s 0.00s p=1.000 n=6
Total Time 21.30s (± 0.21%) 21.13s (± 0.43%) -0.17s (- 0.80%) 21.01s 21.23s p=0.005 n=6
xstate - node (v18.10.0, x64)
Memory used 548,608k (± 0.03%) 548,305k (± 0.02%) -302k (- 0.06%) 548,209k 548,519k p=0.013 n=6
Parse Time 4.06s (± 0.37%) 4.08s (± 0.51%) +0.03s (+ 0.70%) 4.06s 4.11s p=0.043 n=6
Bind Time 1.72s (± 1.14%) 1.73s (± 0.94%) ~ 1.71s 1.75s p=0.935 n=6
Check Time 2.81s (± 0.70%) 2.75s (± 0.59%) -0.07s (- 2.37%) 2.72s 2.76s p=0.005 n=6
Emit Time 0.08s (± 0.00%) 0.08s (± 0.00%) ~ 0.08s 0.08s p=1.000 n=6
Total Time 8.67s (± 0.33%) 8.63s (± 0.38%) ~ 8.59s 8.67s p=0.078 n=6
Angular - node (v16.17.1, x64)
Memory used 358,760k (± 0.01%) 358,636k (± 0.00%) -124k (- 0.03%) 358,617k 358,646k p=0.005 n=6
Parse Time 3.72s (± 0.63%) 3.72s (± 0.52%) ~ 3.70s 3.75s p=0.871 n=6
Bind Time 1.22s (± 0.42%) 1.23s (± 0.42%) ~ 1.22s 1.23s p=0.311 n=6
Check Time 9.54s (± 0.49%) 9.43s (± 0.71%) -0.11s (- 1.12%) 9.35s 9.55s p=0.020 n=6
Emit Time 8.12s (± 1.35%) 8.07s (± 0.36%) ~ 8.03s 8.12s p=0.625 n=6
Total Time 22.60s (± 0.48%) 22.45s (± 0.39%) -0.15s (- 0.67%) 22.33s 22.60s p=0.024 n=6
Compiler-Unions - node (v16.17.1, x64)
Memory used 191,518k (± 0.02%) 191,427k (± 0.05%) ~ 191,294k 191,517k p=0.093 n=6
Parse Time 1.57s (± 0.67%) 1.57s (± 0.96%) ~ 1.56s 1.60s p=0.406 n=6
Bind Time 0.84s (± 0.00%) 0.84s (± 0.75%) ~ 0.83s 0.85s p=1.000 n=6
Check Time 10.13s (± 0.44%) 9.99s (± 0.74%) -0.13s (- 1.28%) 9.88s 10.09s p=0.013 n=6
Emit Time 3.08s (± 0.96%) 3.07s (± 0.92%) ~ 3.03s 3.11s p=0.683 n=6
Total Time 15.60s (± 0.34%) 15.48s (± 0.50%) -0.13s (- 0.82%) 15.37s 15.57s p=0.013 n=6
Monaco - node (v16.17.1, x64)
Memory used 343,256k (± 0.00%) 343,110k (± 0.01%) -146k (- 0.04%) 343,083k 343,128k p=0.005 n=6
Parse Time 2.80s (± 0.52%) 2.81s (± 0.75%) ~ 2.78s 2.83s p=0.417 n=6
Bind Time 1.11s (± 0.68%) 1.11s (± 0.37%) ~ 1.11s 1.12s p=1.000 n=6
Check Time 7.77s (± 0.22%) 7.70s (± 0.45%) -0.07s (- 0.94%) 7.65s 7.75s p=0.006 n=6
Emit Time 4.50s (± 0.57%) 4.54s (± 0.60%) ~ 4.51s 4.57s p=0.089 n=6
Total Time 16.18s (± 0.17%) 16.16s (± 0.36%) ~ 16.04s 16.19s p=0.191 n=6
TFS - node (v16.17.1, x64)
Memory used 299,386k (± 0.01%) 299,277k (± 0.01%) -108k (- 0.04%) 299,261k 299,302k p=0.005 n=6
Parse Time 2.19s (± 0.53%) 2.19s (± 0.58%) ~ 2.18s 2.21s p=0.931 n=6
Bind Time 1.26s (± 0.65%) 1.26s (± 0.41%) ~ 1.25s 1.26s p=0.929 n=6
Check Time 7.21s (± 0.35%) 7.17s (± 0.33%) -0.04s (- 0.58%) 7.13s 7.19s p=0.009 n=6
Emit Time 4.22s (± 0.56%) 4.24s (± 0.42%) ~ 4.21s 4.26s p=0.140 n=6
Total Time 14.87s (± 0.37%) 14.86s (± 0.27%) ~ 14.81s 14.91s p=0.747 n=6
material-ui - node (v16.17.1, x64)
Memory used 475,716k (± 0.01%) 475,584k (± 0.00%) -131k (- 0.03%) 475,563k 475,613k p=0.005 n=6
Parse Time 3.33s (± 0.31%) 3.34s (± 0.27%) ~ 3.33s 3.35s p=0.054 n=6
Bind Time 1.02s (± 0.50%) 1.02s (± 0.40%) ~ 1.02s 1.03s p=0.595 n=6
Check Time 18.15s (± 0.45%) 18.04s (± 0.35%) -0.11s (- 0.61%) 17.97s 18.15s p=0.037 n=6
Emit Time 0.00s (± 0.00%) 0.00s (± 0.00%) ~ 0.00s 0.00s p=1.000 n=6
Total Time 22.50s (± 0.37%) 22.41s (± 0.30%) ~ 22.34s 22.53s p=0.107 n=6
xstate - node (v16.17.1, x64)
Memory used 546,058k (± 0.02%) 545,885k (± 0.02%) -174k (- 0.03%) 545,780k 546,048k p=0.031 n=6
Parse Time 4.24s (± 0.19%) 4.26s (± 0.26%) +0.02s (+ 0.39%) 4.24s 4.27s p=0.027 n=6
Bind Time 1.81s (± 0.29%) 1.81s (± 0.49%) ~ 1.80s 1.82s p=0.541 n=6
Check Time 3.07s (± 0.63%) 2.96s (± 0.39%) 🟩-0.11s (- 3.48%) 2.94s 2.97s p=0.005 n=6
Emit Time 0.09s (± 0.00%) 0.09s (± 0.00%) ~ 0.09s 0.09s p=1.000 n=6
Total Time 9.21s (± 0.20%) 9.12s (± 0.19%) -0.09s (- 0.94%) 9.09s 9.14s p=0.005 n=6
Angular - node (v14.15.1, x64)
Memory used 352,281k (± 0.00%) 352,287k (± 0.00%) ~ 352,267k 352,299k p=0.423 n=6
Parse Time 3.71s (± 0.41%) 3.72s (± 0.47%) ~ 3.70s 3.75s p=0.511 n=6
Bind Time 1.28s (± 0.32%) 1.28s (± 0.40%) ~ 1.28s 1.29s p=0.595 n=6
Check Time 9.82s (± 0.39%) 9.71s (± 0.44%) -0.11s (- 1.14%) 9.65s 9.77s p=0.006 n=6
Emit Time 8.40s (± 0.73%) 8.34s (± 0.52%) ~ 8.27s 8.39s p=0.109 n=6
Total Time 23.22s (± 0.28%) 23.06s (± 0.35%) -0.16s (- 0.70%) 22.92s 23.16s p=0.008 n=6
Compiler-Unions - node (v14.15.1, x64)
Memory used 187,203k (± 0.71%) 186,652k (± 0.03%) ~ 186,584k 186,704k p=0.471 n=6
Parse Time 1.57s (± 0.52%) 1.58s (± 0.53%) ~ 1.57s 1.59s p=0.050 n=6
Bind Time 0.85s (± 0.64%) 0.86s (± 0.88%) ~ 0.85s 0.87s p=0.476 n=6
Check Time 10.17s (± 0.32%) 10.17s (± 0.60%) ~ 10.08s 10.24s p=0.748 n=6
Emit Time 3.18s (± 0.92%) 3.16s (± 1.75%) ~ 3.09s 3.24s p=0.628 n=6
Total Time 15.78s (± 0.26%) 15.77s (± 0.56%) ~ 15.61s 15.86s p=0.748 n=6
Monaco - node (v14.15.1, x64)
Memory used 338,099k (± 0.00%) 338,068k (± 0.01%) -30k (- 0.01%) 338,032k 338,093k p=0.013 n=6
Parse Time 2.90s (± 0.28%) 2.90s (± 0.14%) ~ 2.90s 2.91s p=0.206 n=6
Bind Time 1.12s (± 0.49%) 1.12s (± 1.66%) ~ 1.11s 1.16s p=0.476 n=6
Check Time 8.14s (± 0.59%) 8.08s (± 0.44%) ~ 8.03s 8.13s p=0.054 n=6
Emit Time 4.78s (± 0.50%) 4.78s (± 0.86%) ~ 4.74s 4.84s p=0.629 n=6
Total Time 16.94s (± 0.37%) 16.89s (± 0.34%) ~ 16.83s 16.96s p=0.170 n=6
TFS - node (v14.15.1, x64)
Memory used 294,322k (± 0.00%) 294,278k (± 0.00%) -44k (- 0.02%) 294,264k 294,299k p=0.005 n=6
Parse Time 2.38s (± 1.04%) 2.40s (± 1.08%) ~ 2.36s 2.42s p=0.420 n=6
Bind Time 1.11s (± 0.95%) 1.10s (± 1.10%) ~ 1.08s 1.11s p=0.282 n=6
Check Time 7.54s (± 0.38%) 7.48s (± 0.45%) -0.05s (- 0.73%) 7.43s 7.51s p=0.016 n=6
Emit Time 4.62s (± 0.54%) 4.62s (± 0.45%) ~ 4.59s 4.65s p=0.935 n=6
Total Time 15.65s (± 0.26%) 15.60s (± 0.41%) ~ 15.50s 15.66s p=0.260 n=6
material-ui - node (v14.15.1, x64)
Memory used 471,221k (± 0.00%) 471,114k (± 0.00%) -107k (- 0.02%) 471,089k 471,142k p=0.005 n=6
Parse Time 3.49s (± 0.35%) 3.51s (± 0.43%) ~ 3.48s 3.52s p=0.059 n=6
Bind Time 1.04s (± 0.50%) 1.04s (± 0.86%) ~ 1.03s 1.05s p=0.541 n=6
Check Time 19.13s (± 0.46%) 18.94s (± 0.31%) -0.19s (- 0.97%) 18.83s 19.00s p=0.005 n=6
Emit Time 0.00s (± 0.00%) 0.00s (± 0.00%) ~ 0.00s 0.00s p=1.000 n=6
Total Time 23.66s (± 0.40%) 23.49s (± 0.22%) -0.17s (- 0.71%) 23.40s 23.55s p=0.005 n=6
xstate - node (v14.15.1, x64)
Memory used 534,492k (± 0.01%) 534,462k (± 0.01%) ~ 534,421k 534,540k p=0.230 n=6
Parse Time 4.58s (± 0.18%) 4.58s (± 0.73%) ~ 4.56s 4.65s p=0.357 n=6
Bind Time 1.72s (± 0.57%) 1.73s (± 0.70%) ~ 1.72s 1.75s p=0.734 n=6
Check Time 3.16s (± 0.53%) 3.14s (± 0.47%) -0.02s (- 0.69%) 3.12s 3.16s p=0.043 n=6
Emit Time 0.10s (± 0.00%) 0.10s (± 4.01%) ~ 0.10s 0.11s p=0.405 n=6
Total Time 9.57s (± 0.21%) 9.57s (± 0.43%) ~ 9.53s 9.64s p=0.468 n=6
System
Machine Namets-ci-ubuntu
Platformlinux 5.4.0-135-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)
Benchmark Name Iterations
Current 52835 6
Baseline main 6

TSServer

Comparison Report - main..52835
Metric main 52835 Delta Best Worst p-value
Compiler-UnionsTSServer - node (v18.10.0, x64)
Req 1 - updateOpen 2,379ms (± 1.15%) 2,376ms (± 0.33%) ~ 2,365ms 2,383ms p=0.936 n=6
Req 2 - geterr 5,371ms (± 0.57%) 5,306ms (± 0.76%) -66ms (- 1.22%) 5,254ms 5,357ms p=0.020 n=6
Req 3 - references 341ms (± 0.99%) 337ms (± 0.74%) ~ 333ms 340ms p=0.089 n=6
Req 4 - navto 281ms (± 0.65%) 284ms (± 0.39%) +3ms (+ 1.13%) 283ms 286ms p=0.021 n=6
Req 5 - completionInfo count 1,356 (± 0.00%) 1,356 (± 0.00%) ~ 1,356 1,356 p=1.000 n=6
Req 5 - completionInfo 72ms (± 1.52%) 71ms (± 1.06%) ~ 70ms 72ms p=0.195 n=6
CompilerTSServer - node (v18.10.0, x64)
Req 1 - updateOpen 2,503ms (± 0.78%) 2,511ms (± 0.94%) ~ 2,482ms 2,547ms p=0.689 n=6
Req 2 - geterr 4,037ms (± 0.75%) 3,996ms (± 0.43%) -41ms (- 1.02%) 3,971ms 4,017ms p=0.037 n=6
Req 3 - references 353ms (± 0.51%) 352ms (± 0.28%) ~ 351ms 353ms p=0.508 n=6
Req 4 - navto 288ms (± 0.56%) 289ms (± 0.60%) ~ 287ms 292ms p=0.408 n=6
Req 5 - completionInfo count 1,518 (± 0.00%) 1,518 (± 0.00%) ~ 1,518 1,518 p=1.000 n=6
Req 5 - completionInfo 68ms (± 0.81%) 68ms (± 0.81%) ~ 67ms 68ms p=1.000 n=6
xstateTSServer - node (v18.10.0, x64)
Req 1 - updateOpen 3,190ms (± 0.65%) 3,186ms (± 0.34%) ~ 3,175ms 3,202ms p=0.748 n=6
Req 2 - geterr 1,640ms (± 0.71%) 1,614ms (± 0.54%) -27ms (- 1.63%) 1,601ms 1,624ms p=0.005 n=6
Req 3 - references 104ms (± 1.22%) 103ms (± 1.37%) ~ 101ms 105ms p=0.279 n=6
Req 4 - navto 357ms (± 0.91%) 357ms (± 0.42%) ~ 355ms 359ms p=0.511 n=6
Req 5 - completionInfo count 3,136 (± 0.00%) 3,136 (± 0.00%) ~ 3,136 3,136 p=1.000 n=6
Req 5 - completionInfo 426ms (± 1.09%) 427ms (± 1.04%) ~ 419ms 432ms p=0.685 n=6
Compiler-UnionsTSServer - node (v16.17.1, x64)
Req 1 - updateOpen 2,535ms (± 0.66%) 2,527ms (± 0.89%) ~ 2,499ms 2,561ms p=0.575 n=6
Req 2 - geterr 5,757ms (± 0.62%) 5,690ms (± 0.38%) -67ms (- 1.16%) 5,660ms 5,713ms p=0.020 n=6
Req 3 - references 350ms (± 0.58%) 352ms (± 0.55%) ~ 349ms 354ms p=0.089 n=6
Req 4 - navto 280ms (± 0.84%) 278ms (± 0.81%) ~ 275ms 281ms p=0.162 n=6
Req 5 - completionInfo count 1,356 (± 0.00%) 1,356 (± 0.00%) ~ 1,356 1,356 p=1.000 n=6
Req 5 - completionInfo 84ms (± 3.80%) 82ms (± 4.49%) ~ 77ms 85ms p=0.224 n=6
CompilerTSServer - node (v16.17.1, x64)
Req 1 - updateOpen 2,683ms (± 1.20%) 2,702ms (± 0.48%) ~ 2,683ms 2,714ms p=0.173 n=6
Req 2 - geterr 4,377ms (± 0.50%) 4,352ms (± 0.42%) -25ms (- 0.58%) 4,324ms 4,371ms p=0.045 n=6
Req 3 - references 366ms (± 1.04%) 363ms (± 1.07%) ~ 358ms 368ms p=0.226 n=6
Req 4 - navto 282ms (± 1.16%) 286ms (± 0.26%) ~ 285ms 287ms p=0.098 n=6
Req 5 - completionInfo count 1,518 (± 0.00%) 1,518 (± 0.00%) ~ 1,518 1,518 p=1.000 n=6
Req 5 - completionInfo 73ms (± 0.87%) 73ms (± 0.56%) ~ 73ms 74ms p=0.673 n=6
xstateTSServer - node (v16.17.1, x64)
Req 1 - updateOpen 3,370ms (± 0.28%) 3,363ms (± 0.23%) ~ 3,353ms 3,373ms p=0.148 n=6
Req 2 - geterr 1,839ms (± 3.77%) 1,781ms (± 1.37%) 🟩-58ms (- 3.15%) 1,758ms 1,823ms p=0.045 n=6
Req 3 - references 111ms (± 2.13%) 110ms (± 1.96%) ~ 108ms 113ms p=0.934 n=6
Req 4 - navto 345ms (± 1.27%) 343ms (± 0.99%) ~ 340ms 348ms p=0.570 n=6
Req 5 - completionInfo count 3,136 (± 0.00%) 3,136 (± 0.00%) ~ 3,136 3,136 p=1.000 n=6
Req 5 - completionInfo 431ms (± 0.82%) 436ms (± 1.10%) ~ 430ms 443ms p=0.142 n=6
Compiler-UnionsTSServer - node (v14.15.1, x64)
Req 1 - updateOpen 2,624ms (± 0.48%) 2,618ms (± 0.83%) ~ 2,586ms 2,641ms p=1.000 n=6
Req 2 - geterr 6,095ms (± 0.55%) 6,042ms (± 0.37%) -53ms (- 0.87%) 6,012ms 6,074ms p=0.031 n=6
Req 3 - references 366ms (± 0.33%) 367ms (± 0.68%) ~ 364ms 371ms p=0.254 n=6
Req 4 - navto 281ms (± 1.80%) 277ms (± 0.29%) ~ 275ms 277ms p=0.056 n=6
Req 5 - completionInfo count 1,356 (± 0.00%) 1,356 (± 0.00%) ~ 1,356 1,356 p=1.000 n=6
Req 5 - completionInfo 101ms (± 0.63%) 101ms (± 0.63%) ~ 100ms 102ms p=1.000 n=6
CompilerTSServer - node (v14.15.1, x64)
Req 1 - updateOpen 2,838ms (± 0.90%) 2,848ms (± 0.36%) ~ 2,837ms 2,865ms p=0.748 n=6
Req 2 - geterr 4,619ms (± 2.63%) 4,459ms (± 1.92%) 🟩-161ms (- 3.47%) 4,400ms 4,631ms p=0.013 n=6
Req 3 - references 380ms (± 0.86%) 379ms (± 0.49%) ~ 377ms 382ms p=0.292 n=6
Req 4 - navto 293ms (± 1.31%) 295ms (± 0.50%) ~ 293ms 297ms p=0.258 n=6
Req 5 - completionInfo count 1,518 (± 0.00%) 1,518 (± 0.00%) ~ 1,518 1,518 p=1.000 n=6
Req 5 - completionInfo 86ms (± 9.49%) 90ms (±10.68%) ~ 82ms 102ms p=0.254 n=6
xstateTSServer - node (v14.15.1, x64)
Req 1 - updateOpen 3,684ms (± 0.86%) 3,682ms (± 0.51%) ~ 3,659ms 3,704ms p=1.000 n=6
Req 2 - geterr 1,856ms (± 2.24%) 1,815ms (± 1.36%) ~ 1,784ms 1,842ms p=0.128 n=6
Req 3 - references 127ms (± 3.89%) 128ms (± 3.77%) ~ 122ms 134ms p=1.000 n=6
Req 4 - navto 376ms (± 1.62%) 374ms (± 0.57%) ~ 370ms 376ms p=0.332 n=6
Req 5 - completionInfo count 3,136 (± 0.00%) 3,136 (± 0.00%) ~ 3,136 3,136 p=1.000 n=6
Req 5 - completionInfo 457ms (± 2.63%) 464ms (± 2.33%) ~ 449ms 481ms p=0.226 n=6
System
Machine Namets-ci-ubuntu
Platformlinux 5.4.0-135-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)
Benchmark Name Iterations
Current 52835 6
Baseline main 6

Startup

Comparison Report - main..52835
Metric main 52835 Delta Best Worst p-value
tsc-startup - node (v16.17.1, x64)
Execution time 142.31ms (± 0.19%) 142.72ms (± 0.19%) +0.40ms (+ 0.28%) 142.06ms 148.49ms p=0.000 n=600
tsserver-startup - node (v16.17.1, x64)
Execution time 226.77ms (± 0.18%) 227.63ms (± 0.16%) +0.86ms (+ 0.38%) 226.78ms 233.18ms p=0.000 n=600
tsserverlibrary-startup - node (v16.17.1, x64)
Execution time 228.58ms (± 0.21%) 229.19ms (± 0.13%) +0.61ms (+ 0.27%) 228.33ms 233.31ms p=0.000 n=600
typescript-startup - node (v16.17.1, x64)
Execution time 209.39ms (± 0.18%) 209.95ms (± 0.17%) +0.56ms (+ 0.27%) 209.09ms 215.10ms p=0.000 n=600
System
Machine Namets-ci-ubuntu
Platformlinux 5.4.0-135-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)
Benchmark Name Iterations
Current 52835 6
Baseline main 6
All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@DanielRosenwasser
Daniel Rosenwasser (DanielRosenwasser) marked this pull request as ready for review February 18, 2023 04:24
@DanielRosenwasser
Daniel Rosenwasser (DanielRosenwasser) requested review from Anders Hejlsberg (ahejlsberg) and Jake Bailey (jakebailey) February 21, 2023 18:59
@DanielRosenwasser
Re-enable no-var at the end of the scanner's state.
0d549c8
@jakebailey

Jake Bailey (jakebailey) commented Feb 21, 2023

Copy link
Copy Markdown
Member

The parser scanner change was a huge win for the few variables it modified, but this one is 10x less of a win for like 4x the variables changed (a few hundred); do we think it's worth it?

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@jakebailey

Jake Bailey (jakebailey) commented Feb 21, 2023 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Member

Well, I guess xstate is consistently like 3%, and the server tests have good geterr.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@DanielRosenwasser

Daniel Rosenwasser (DanielRosenwasser) commented Feb 21, 2023

Copy link
Copy Markdown
Member Author

do we think it's worth it?

Definitely! I think it's very scoped, and the conceptual cleanliness buys us relatively little - so it's a free win to me. I could never argue with a developer using TypeScript that a 1-3% reduction in type-checking time wasn't worth it because we didn't want to disable our linter.

So I think we should even do this across the compiler. The only thing that might be lacking is some documentation on why it is that we're doing this.

SlurpTheo reacted with eyes emoji
All reactions
  • 👀 1 reaction

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

jakebailey
Jake Bailey (jakebailey) approved these changes Feb 21, 2023
View reviewed changes

@jakebailey Jake Bailey (jakebailey) left a comment •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Member

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

I still don't like it given how it's like 300 variables, but I guess LGTM given they're at the top and rarely touched.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread src/compiler/checker.ts
// Note: we only look at files already found by module resolution,
// so there may be files we did not consider.
const map = new Map<string, boolean>();
var map = new Map<string, boolean>();

@jakebailey Jake Bailey (jakebailey) Feb 21, 2023

Copy link
Copy Markdown
Member

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

Suggested change
var map = new Map<string, boolean>();
const map = new Map<string, boolean>();

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@SlurpTheo SlurpTheo Mar 2, 2023 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

Wait, why did you suggest reverting just this one back to const?

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@jakebailey Jake Bailey (jakebailey) Mar 2, 2023

Copy link
Copy Markdown
Member

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

It's not a top level variable and is only referenced once for this memoized call. There's no way it has any meaningful performance impact.

But, my suggestion wasn't merged anyway and it's not hurting anything either.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

SlurpTheo reacted with thumbs up emoji Zzzen reacted with laugh emoji
All reactions
  • 👍 1 reaction
  • 😄 1 reaction

This comment was marked as outdated.

Sign in to view

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@DanielRosenwasser
Daniel Rosenwasser (DanielRosenwasser) merged commit 27376f1 into main Feb 22, 2023
@DanielRosenwasser
Daniel Rosenwasser (DanielRosenwasser) deleted the letAndConstToVarInChecker branch February 22, 2023 01:35
@DanielRosenwasser Daniel Rosenwasser (DanielRosenwasser) mentioned this pull request Feb 22, 2023
Using var in limited contexts to avoid runtime TDZ checks #52924
Closed
@microsoft Microsoft (microsoft) locked as resolved and limited conversation to collaborators Oct 22, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Reviewers

@jakebailey Jake Bailey (jakebailey) jakebailey approved these changes
@ahejlsberg Anders Hejlsberg (ahejlsberg) Awaiting requested review from ahejlsberg
+1 more reviewer
@SlurpTheo SlurpTheo SlurpTheo left review comments
Reviewers whose approvals may not affect merge requirements

Uh oh!

There was an error while loading. Please reload this page.

Assignees

@DanielRosenwasser Daniel Rosenwasser (DanielRosenwasser)

Labels

Author: Team For Uncommitted Bug PR for untriaged, rejected, closed or missing bug

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

4 participants

@DanielRosenwasser @typescript-bot @jakebailey @SlurpTheo
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.