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

Fix inferences between alias type arguments and defaulted alias type arguments #51771

Merged

Conversation

weswigham
Copy link
Member

@weswigham weswigham commented Dec 5, 2022

Fixes #51698

As I mentioned in the related issue, contrary to speculation during post-standup, the issue wasn't that we were missing the alias identity (actually, to ensure that isn't an issue, we use the target symbol on construction of the alias already), but rather was that we ignored alias type argument defaults during inference. With this, we actually apply the defaults to the alias type argument lists we compare during inference, fixing the issue~

@typescript-bot typescript-bot added Author: Team For Milestone Bug PRs that fix a bug with a specific milestone labels Dec 5, 2022
@weswigham
Copy link
Member Author

@typescript-bot pack this
@typescript-bot user test this inline
@typescript-bot test this
@typescript-bot run dt
@typescript-bot perf test this
@typescript-bot test top100

@typescript-bot
Copy link
Collaborator

typescript-bot commented Dec 5, 2022

Heya @weswigham, I've started to run the parallelized Definitely Typed test suite on this PR at 978b474. You can monitor the build here.

@typescript-bot
Copy link
Collaborator

typescript-bot commented Dec 5, 2022

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

Update: The results are in!

@typescript-bot
Copy link
Collaborator

typescript-bot commented Dec 5, 2022

Heya @weswigham, I've started to run the extended test suite on this PR at 978b474. You can monitor the build here.

@typescript-bot
Copy link
Collaborator

typescript-bot commented Dec 5, 2022

Heya @weswigham, I've started to run the diff-based top-repos suite on this PR at 978b474. You can monitor the build here.

Update: The results are in!

@typescript-bot
Copy link
Collaborator

typescript-bot commented Dec 5, 2022

Heya @weswigham, I've started to run the diff-based user code test suite on this PR at 978b474. You can monitor the build here.

Update: The results are in!

@typescript-bot
Copy link
Collaborator

typescript-bot commented Dec 5, 2022

Heya @weswigham, I've started to run the tarball bundle task on this PR at 978b474. You can monitor the build here.

@typescript-bot
Copy link
Collaborator

typescript-bot commented Dec 5, 2022

Hey @weswigham, I've packed this into an installable tgz. You can install it for testing by referencing it in your package.json like so:

{
    "devDependencies": {
        "typescript": "https://typescript.visualstudio.com/cf7ac146-d525-443c-b23c-0d58337efebc/_apis/build/builds/139679/artifacts?artifactName=tgz&fileId=5B1878611012777CFE6CB28781718D2C6F6F166B2883B597A0D8C2380BE2F63C02&fileName=/typescript-5.0.0-insiders.20221205.tgz"
    }
}

and then running npm install.


There is also a playground for this build and an npm module you can use via "typescript": "npm:@typescript-deploys/pr-build@5.0.0-pr-51771-7".;

@typescript-bot
Copy link
Collaborator

@weswigham Here are the results of running the user test suite comparing main and refs/pull/51771/merge:

Everything looks good!

@typescript-bot
Copy link
Collaborator

Heya @weswigham, I've run the RWC suite on this PR - assuming you're on the TS core team, you can view the resulting diff here.

@typescript-bot
Copy link
Collaborator

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

Here they are:

Compiler

Comparison Report - main..51771
Metric main 51771 Delta Best Worst
Angular - node (v18.10.0, x64)
Memory used 341,051k (± 0.02%) 341,019k (± 0.03%) -31k (- 0.01%) 340,788k 341,200k
Parse Time 1.57s (± 0.66%) 1.58s (± 0.90%) +0.01s (+ 0.51%) 1.55s 1.61s
Bind Time 0.52s (± 1.06%) 0.52s (± 0.86%) -0.00s (- 0.77%) 0.51s 0.53s
Check Time 4.03s (± 0.86%) 4.02s (± 0.48%) -0.01s (- 0.27%) 3.98s 4.07s
Emit Time 4.31s (± 1.36%) 4.26s (± 0.37%) -0.05s (- 1.21%) 4.23s 4.29s
Total Time 10.43s (± 0.88%) 10.37s (± 0.28%) -0.06s (- 0.59%) 10.30s 10.41s
Compiler-Unions - node (v18.10.0, x64)
Memory used 187,300k (± 1.10%) 188,417k (± 1.09%) +1,117k (+ 0.60%) 184,978k 190,748k
Parse Time 0.62s (± 0.48%) 0.61s (± 0.73%) -0.01s (- 0.97%) 0.60s 0.62s
Bind Time 0.33s (± 1.04%) 0.33s (± 1.12%) -0.00s (- 0.31%) 0.32s 0.33s
Check Time 5.05s (± 0.62%) 4.99s (± 0.39%) -0.06s (- 1.13%) 4.95s 5.04s
Emit Time 1.56s (± 1.44%) 1.55s (± 0.34%) -0.01s (- 0.83%) 1.54s 1.56s
Total Time 7.55s (± 0.47%) 7.47s (± 0.24%) -0.08s (- 1.06%) 7.44s 7.52s
Monaco - node (v18.10.0, x64)
Memory used 320,491k (± 0.02%) 320,445k (± 0.02%) -45k (- 0.01%) 320,228k 320,651k
Parse Time 1.16s (± 0.92%) 1.14s (± 1.01%) -0.01s (- 1.04%) 1.12s 1.17s
Bind Time 0.49s (± 1.36%) 0.49s (± 1.40%) -0.00s (- 0.82%) 0.47s 0.50s
Check Time 3.88s (± 0.41%) 3.85s (± 0.79%) -0.03s (- 0.75%) 3.81s 3.92s
Emit Time 2.27s (± 0.65%) 2.24s (± 0.83%) -0.03s (- 1.28%) 2.22s 2.29s
Total Time 7.79s (± 0.31%) 7.72s (± 0.32%) -0.07s (- 0.86%) 7.67s 7.77s
TFS - node (v18.10.0, x64)
Memory used 283,328k (± 0.20%) 282,929k (± 0.02%) -399k (- 0.14%) 282,779k 283,024k
Parse Time 0.96s (± 2.67%) 0.95s (± 1.34%) -0.01s (- 1.24%) 0.93s 0.99s
Bind Time 0.46s (± 8.41%) 0.46s (± 8.70%) +0.00s (+ 0.22%) 0.43s 0.58s
Check Time 3.81s (± 0.49%) 3.80s (± 0.77%) -0.01s (- 0.18%) 3.74s 3.88s
Emit Time 2.23s (± 0.52%) 2.20s (± 0.55%) -0.03s (- 1.30%) 2.17s 2.22s
Total Time 7.46s (± 0.51%) 7.41s (± 0.72%) -0.05s (- 0.68%) 7.33s 7.56s
material-ui - node (v18.10.0, x64)
Memory used 435,962k (± 0.01%) 435,934k (± 0.01%) -27k (- 0.01%) 435,877k 436,144k
Parse Time 1.32s (± 0.69%) 1.31s (± 0.51%) -0.01s (- 1.06%) 1.29s 1.32s
Bind Time 0.49s (± 2.57%) 0.49s (± 2.13%) -0.00s (- 0.61%) 0.45s 0.50s
Check Time 10.41s (± 0.81%) 10.35s (± 0.74%) -0.06s (- 0.53%) 10.22s 10.52s
Emit Time 0.00s (± 0.00%) 0.00s (± 0.00%) 0.00s ( NaN%) 0.00s 0.00s
Total Time 12.22s (± 0.73%) 12.15s (± 0.70%) -0.07s (- 0.57%) 12.00s 12.33s
xstate - node (v18.10.0, x64)
Memory used 518,433k (± 0.01%) 518,449k (± 0.01%) +15k (+ 0.00%) 518,328k 518,612k
Parse Time 1.89s (± 0.44%) 1.88s (± 0.48%) -0.01s (- 0.48%) 1.86s 1.90s
Bind Time 0.70s (± 2.50%) 0.70s (± 2.63%) -0.00s (- 0.14%) 0.68s 0.75s
Check Time 1.05s (± 0.84%) 1.04s (± 0.87%) -0.01s (- 0.76%) 1.02s 1.06s
Emit Time 0.05s (± 0.00%) 0.05s (± 0.00%) 0.00s ( 0.00%) 0.05s 0.05s
Total Time 3.69s (± 0.75%) 3.67s (± 0.61%) -0.02s (- 0.54%) 3.64s 3.72s
Angular - node (v16.17.1, x64)
Memory used 340,516k (± 0.01%) 340,494k (± 0.02%) -22k (- 0.01%) 340,323k 340,582k
Parse Time 1.87s (± 0.59%) 1.85s (± 0.51%) -0.01s (- 0.70%) 1.83s 1.87s
Bind Time 0.65s (± 0.56%) 0.65s (± 0.58%) -0.00s (- 0.15%) 0.64s 0.65s
Check Time 5.15s (± 0.55%) 5.15s (± 0.63%) -0.00s (- 0.08%) 5.10s 5.23s
Emit Time 5.12s (± 0.99%) 5.07s (± 0.42%) -0.04s (- 0.82%) 5.02s 5.11s
Total Time 12.79s (± 0.57%) 12.72s (± 0.41%) -0.06s (- 0.49%) 12.63s 12.84s
Compiler-Unions - node (v16.17.1, x64)
Memory used 187,686k (± 0.59%) 187,344k (± 0.52%) -342k (- 0.18%) 186,626k 190,013k
Parse Time 0.79s (± 0.92%) 0.80s (± 1.12%) +0.00s (+ 0.38%) 0.77s 0.81s
Bind Time 0.42s (± 1.07%) 0.42s (± 1.14%) -0.00s (- 0.24%) 0.41s 0.43s
Check Time 6.11s (± 0.43%) 6.06s (± 0.61%) -0.05s (- 0.82%) 5.99s 6.14s
Emit Time 1.94s (± 0.54%) 1.94s (± 0.45%) 0.00s ( 0.00%) 1.93s 1.96s
Total Time 9.27s (± 0.40%) 9.22s (± 0.45%) -0.05s (- 0.54%) 9.14s 9.31s
Monaco - node (v16.17.1, x64)
Memory used 319,841k (± 0.05%) 319,755k (± 0.01%) -86k (- 0.03%) 319,701k 319,850k
Parse Time 1.41s (± 0.71%) 1.41s (± 0.78%) -0.01s (- 0.49%) 1.39s 1.44s
Bind Time 0.59s (± 0.62%) 0.59s (± 0.88%) -0.00s (- 0.67%) 0.58s 0.60s
Check Time 4.89s (± 0.44%) 4.88s (± 0.37%) -0.01s (- 0.23%) 4.82s 4.90s
Emit Time 2.75s (± 1.16%) 2.73s (± 1.08%) -0.02s (- 0.65%) 2.69s 2.81s
Total Time 9.65s (± 0.51%) 9.60s (± 0.46%) -0.04s (- 0.46%) 9.53s 9.70s
TFS - node (v16.17.1, x64)
Memory used 282,522k (± 0.16%) 282,284k (± 0.01%) -238k (- 0.08%) 282,228k 282,359k
Parse Time 1.16s (± 0.81%) 1.16s (± 0.51%) -0.00s (- 0.09%) 1.14s 1.17s
Bind Time 0.66s (± 4.58%) 0.64s (± 4.96%) -0.02s (- 2.58%) 0.58s 0.70s
Check Time 4.78s (± 0.43%) 4.77s (± 0.40%) -0.01s (- 0.21%) 4.73s 4.83s
Emit Time 2.77s (± 1.75%) 2.80s (± 2.13%) +0.03s (+ 1.01%) 2.70s 2.91s
Total Time 9.37s (± 0.70%) 9.37s (± 0.78%) -0.00s (- 0.03%) 9.24s 9.54s
material-ui - node (v16.17.1, x64)
Memory used 435,299k (± 0.00%) 435,313k (± 0.00%) +14k (+ 0.00%) 435,275k 435,365k
Parse Time 1.63s (± 0.50%) 1.62s (± 0.55%) -0.02s (- 1.04%) 1.60s 1.64s
Bind Time 0.51s (± 0.92%) 0.50s (± 0.59%) -0.01s (- 1.57%) 0.50s 0.51s
Check Time 11.92s (± 0.67%) 11.81s (± 0.51%) -0.11s (- 0.89%) 11.68s 11.96s
Emit Time 0.00s (± 0.00%) 0.00s (± 0.00%) 0.00s ( NaN%) 0.00s 0.00s
Total Time 14.06s (± 0.60%) 13.93s (± 0.50%) -0.13s (- 0.91%) 13.80s 14.12s
xstate - node (v16.17.1, x64)
Memory used 516,012k (± 0.01%) 515,986k (± 0.00%) -26k (- 0.01%) 515,935k 516,052k
Parse Time 2.26s (± 0.39%) 2.26s (± 0.48%) -0.00s (- 0.09%) 2.24s 2.29s
Bind Time 0.84s (± 1.65%) 0.83s (± 2.06%) -0.01s (- 0.84%) 0.81s 0.89s
Check Time 1.36s (± 0.95%) 1.36s (± 0.85%) +0.00s (+ 0.00%) 1.33s 1.38s
Emit Time 0.06s (± 0.00%) 0.06s (± 0.00%) 0.00s ( 0.00%) 0.06s 0.06s
Total Time 4.52s (± 0.46%) 4.52s (± 0.56%) -0.00s (- 0.11%) 4.47s 4.58s
Angular - node (v14.15.1, x64)
Memory used 333,994k (± 0.00%) 334,002k (± 0.01%) +9k (+ 0.00%) 333,930k 334,074k
Parse Time 2.04s (± 0.81%) 2.03s (± 0.43%) -0.01s (- 0.49%) 2.02s 2.05s
Bind Time 0.70s (± 0.74%) 0.70s (± 1.94%) +0.00s (+ 0.43%) 0.69s 0.75s
Check Time 5.51s (± 0.42%) 5.51s (± 0.48%) +0.00s (+ 0.02%) 5.46s 5.58s
Emit Time 5.42s (± 0.75%) 5.35s (± 0.80%) -0.07s (- 1.37%) 5.25s 5.46s
Total Time 13.67s (± 0.47%) 13.59s (± 0.49%) -0.08s (- 0.59%) 13.45s 13.72s
Compiler-Unions - node (v14.15.1, x64)
Memory used 182,643k (± 0.64%) 183,044k (± 0.68%) +401k (+ 0.22%) 181,664k 185,137k
Parse Time 0.89s (± 0.42%) 0.89s (± 1.44%) +0.01s (+ 0.90%) 0.88s 0.94s
Bind Time 0.45s (± 0.66%) 0.46s (± 0.80%) +0.00s (+ 0.88%) 0.45s 0.46s
Check Time 6.39s (± 0.75%) 6.39s (± 0.69%) +0.00s (+ 0.00%) 6.29s 6.49s
Emit Time 2.05s (± 0.86%) 2.05s (± 0.69%) -0.00s (- 0.15%) 2.02s 2.08s
Total Time 9.77s (± 0.58%) 9.78s (± 0.59%) +0.01s (+ 0.08%) 9.67s 9.93s
Monaco - node (v14.15.1, x64)
Memory used 314,566k (± 0.01%) 314,686k (± 0.05%) +120k (+ 0.04%) 314,536k 315,316k
Parse Time 1.57s (± 0.95%) 1.56s (± 0.61%) -0.01s (- 0.89%) 1.53s 1.57s
Bind Time 0.64s (± 0.94%) 0.63s (± 0.92%) -0.00s (- 0.31%) 0.62s 0.65s
Check Time 5.23s (± 0.53%) 5.20s (± 0.50%) -0.03s (- 0.54%) 5.13s 5.24s
Emit Time 2.90s (± 0.73%) 2.88s (± 0.49%) -0.03s (- 0.96%) 2.84s 2.90s
Total Time 10.33s (± 0.57%) 10.26s (± 0.31%) -0.07s (- 0.70%) 10.19s 10.34s
TFS - node (v14.15.1, x64)
Memory used 279,373k (± 0.01%) 279,388k (± 0.01%) +15k (+ 0.01%) 279,335k 279,445k
Parse Time 1.34s (± 0.97%) 1.34s (± 2.25%) -0.01s (- 0.37%) 1.28s 1.43s
Bind Time 0.59s (± 0.38%) 0.59s (± 0.38%) 0.00s ( 0.00%) 0.58s 0.59s
Check Time 5.12s (± 0.34%) 5.10s (± 0.64%) -0.02s (- 0.45%) 5.03s 5.19s
Emit Time 3.13s (± 0.74%) 3.08s (± 0.58%) -0.05s (- 1.47%) 3.04s 3.12s
Total Time 10.18s (± 0.31%) 10.10s (± 0.43%) -0.08s (- 0.75%) 10.00s 10.20s
material-ui - node (v14.15.1, x64)
Memory used 430,756k (± 0.01%) 430,768k (± 0.01%) +12k (+ 0.00%) 430,714k 430,841k
Parse Time 1.86s (± 0.47%) 1.85s (± 0.59%) -0.01s (- 0.43%) 1.83s 1.88s
Bind Time 0.54s (± 0.93%) 0.53s (± 0.76%) -0.01s (- 1.12%) 0.52s 0.54s
Check Time 12.35s (± 0.75%) 12.24s (± 0.56%) -0.12s (- 0.93%) 12.07s 12.37s
Emit Time 0.00s (± 0.00%) 0.00s (± 0.00%) 0.00s ( NaN%) 0.00s 0.00s
Total Time 14.75s (± 0.66%) 14.62s (± 0.51%) -0.13s (- 0.85%) 14.44s 14.75s
xstate - node (v14.15.1, x64)
Memory used 504,343k (± 0.01%) 504,394k (± 0.01%) +50k (+ 0.01%) 504,199k 504,460k
Parse Time 2.55s (± 0.37%) 2.54s (± 0.34%) -0.01s (- 0.47%) 2.52s 2.56s
Bind Time 0.84s (± 0.73%) 0.84s (± 0.57%) -0.00s (- 0.48%) 0.83s 0.85s
Check Time 1.47s (± 0.59%) 1.48s (± 0.61%) +0.01s (+ 0.61%) 1.47s 1.51s
Emit Time 0.07s (± 0.00%) 0.07s (± 0.00%) 0.00s ( 0.00%) 0.07s 0.07s
Total Time 4.93s (± 0.28%) 4.93s (± 0.31%) 0.00s ( 0.00%) 4.91s 4.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)
Benchmark Name Iterations
Current 51771 10
Baseline main 10

TSServer

Comparison Report - main..51771
Metric main 51771 Delta Best Worst
Compiler-UnionsTSServer - node (v18.10.0, x64)
Req 1 - updateOpen 1,053ms (± 0.68%) 1,047ms (± 0.43%) -6ms (- 0.57%) 1,038ms 1,059ms
Req 2 - geterr 2,594ms (± 0.88%) 2,581ms (± 0.67%) -13ms (- 0.49%) 2,540ms 2,623ms
Req 3 - references 166ms (± 0.54%) 165ms (± 0.70%) -0ms (- 0.18%) 163ms 168ms
Req 4 - navto 139ms (± 0.59%) 139ms (± 0.75%) +0ms (+ 0.07%) 137ms 142ms
Req 5 - completionInfo count 1,356 (± 0.00%) 1,356 (± 0.00%) 0 ( 0.00%) 1,356 1,356
Req 5 - completionInfo 60ms (± 3.02%) 61ms (± 2.93%) +1ms (+ 1.16%) 54ms 63ms
CompilerTSServer - node (v18.10.0, x64)
Req 1 - updateOpen 1,114ms (± 0.58%) 1,102ms (± 0.90%) -12ms (- 1.10%) 1,083ms 1,125ms
Req 2 - geterr 1,614ms (± 0.75%) 1,602ms (± 0.92%) -13ms (- 0.79%) 1,579ms 1,638ms
Req 3 - references 169ms (± 0.68%) 169ms (± 0.65%) -0ms (- 0.18%) 167ms 172ms
Req 4 - navto 152ms (± 0.58%) 151ms (± 0.86%) -2ms (- 1.12%) 148ms 153ms
Req 5 - completionInfo count 1,518 (± 0.00%) 1,518 (± 0.00%) 0 ( 0.00%) 1,518 1,518
Req 5 - completionInfo 54ms (± 1.61%) 52ms (± 1.85%) 🟩-2ms (- 3.16%) 51ms 55ms
xstateTSServer - node (v18.10.0, x64)
Req 1 - updateOpen 1,510ms (± 0.76%) 1,501ms (± 0.75%) -10ms (- 0.65%) 1,483ms 1,523ms
Req 2 - geterr 559ms (± 0.77%) 557ms (± 0.80%) -2ms (- 0.30%) 548ms 569ms
Req 3 - references 59ms (± 2.39%) 59ms (± 3.63%) +0ms (+ 0.68%) 57ms 67ms
Req 4 - navto 197ms (± 1.09%) 196ms (± 0.84%) -1ms (- 0.36%) 194ms 200ms
Req 5 - completionInfo count 3,154 (± 0.00%) 3,154 (± 0.00%) 0 ( 0.00%) 3,154 3,154
Req 5 - completionInfo 213ms (± 0.87%) 211ms (± 0.81%) -2ms (- 1.03%) 208ms 215ms
Compiler-UnionsTSServer - node (v16.17.1, x64)
Req 1 - updateOpen 1,306ms (± 0.60%) 1,305ms (± 0.70%) -1ms (- 0.11%) 1,285ms 1,322ms
Req 2 - geterr 3,235ms (± 0.53%) 3,220ms (± 0.79%) -15ms (- 0.47%) 3,178ms 3,275ms
Req 3 - references 191ms (± 0.53%) 192ms (± 0.78%) +1ms (+ 0.42%) 190ms 195ms
Req 4 - navto 151ms (± 0.83%) 150ms (± 1.01%) -1ms (- 0.46%) 148ms 154ms
Req 5 - completionInfo count 1,356 (± 0.00%) 1,356 (± 0.00%) 0 ( 0.00%) 1,356 1,356
Req 5 - completionInfo 63ms (± 5.97%) 61ms (± 4.01%) -1ms (- 2.24%) 58ms 70ms
CompilerTSServer - node (v16.17.1, x64)
Req 1 - updateOpen 1,400ms (± 0.70%) 1,387ms (± 1.06%) -12ms (- 0.88%) 1,361ms 1,413ms
Req 2 - geterr 2,117ms (± 0.45%) 2,114ms (± 0.70%) -3ms (- 0.16%) 2,077ms 2,134ms
Req 3 - references 199ms (± 0.67%) 198ms (± 0.63%) -1ms (- 0.45%) 196ms 201ms
Req 4 - navto 165ms (± 0.99%) 165ms (± 0.97%) +0ms (+ 0.18%) 161ms 168ms
Req 5 - completionInfo count 1,518 (± 0.00%) 1,518 (± 0.00%) 0 ( 0.00%) 1,518 1,518
Req 5 - completionInfo 58ms (± 2.95%) 56ms (± 1.08%) 🟩-3ms (- 4.64%) 54ms 57ms
xstateTSServer - node (v16.17.1, x64)
Req 1 - updateOpen 1,817ms (± 0.76%) 1,812ms (± 0.54%) -5ms (- 0.29%) 1,795ms 1,836ms
Req 2 - geterr 723ms (± 0.88%) 721ms (± 0.57%) -2ms (- 0.28%) 709ms 729ms
Req 3 - references 67ms (± 1.05%) 68ms (± 1.23%) +1ms (+ 0.90%) 66ms 70ms
Req 4 - navto 199ms (± 0.85%) 198ms (± 0.81%) -1ms (- 0.40%) 194ms 202ms
Req 5 - completionInfo count 3,154 (± 0.00%) 3,154 (± 0.00%) 0 ( 0.00%) 3,154 3,154
Req 5 - completionInfo 256ms (± 1.32%) 255ms (± 0.64%) -1ms (- 0.43%) 252ms 259ms
Compiler-UnionsTSServer - node (v14.15.1, x64)
Req 1 - updateOpen 1,457ms (± 0.60%) 1,449ms (± 0.41%) -8ms (- 0.53%) 1,434ms 1,459ms
Req 2 - geterr 3,457ms (± 0.95%) 3,439ms (± 0.96%) -19ms (- 0.54%) 3,390ms 3,513ms
Req 3 - references 207ms (± 0.57%) 205ms (± 0.49%) -2ms (- 0.87%) 203ms 208ms
Req 4 - navto 163ms (± 1.20%) 162ms (± 0.96%) -1ms (- 0.31%) 159ms 166ms
Req 5 - completionInfo count 1,356 (± 0.00%) 1,356 (± 0.00%) 0 ( 0.00%) 1,356 1,356
Req 5 - completionInfo 57ms (± 0.83%) 57ms (± 0.91%) -0ms (- 0.35%) 56ms 58ms
CompilerTSServer - node (v14.15.1, x64)
Req 1 - updateOpen 1,529ms (± 0.42%) 1,524ms (± 0.51%) -5ms (- 0.35%) 1,512ms 1,549ms
Req 2 - geterr 2,300ms (± 0.62%) 2,302ms (± 0.64%) +2ms (+ 0.07%) 2,271ms 2,336ms
Req 3 - references 217ms (± 0.88%) 218ms (± 1.20%) +2ms (+ 0.69%) 212ms 224ms
Req 4 - navto 175ms (± 0.77%) 173ms (± 0.92%) -1ms (- 0.74%) 170ms 176ms
Req 5 - completionInfo count 1,518 (± 0.00%) 1,518 (± 0.00%) 0 ( 0.00%) 1,518 1,518
Req 5 - completionInfo 56ms (± 1.38%) 56ms (± 0.85%) -0ms (- 0.71%) 55ms 57ms
xstateTSServer - node (v14.15.1, x64)
Req 1 - updateOpen 2,015ms (± 0.94%) 2,000ms (± 0.31%) -15ms (- 0.74%) 1,987ms 2,016ms
Req 2 - geterr 746ms (± 0.45%) 743ms (± 0.31%) -3ms (- 0.36%) 738ms 749ms
Req 3 - references 73ms (± 1.19%) 73ms (± 1.19%) 0ms ( 0.00%) 72ms 75ms
Req 4 - navto 218ms (± 0.59%) 219ms (± 1.17%) +0ms (+ 0.14%) 211ms 224ms
Req 5 - completionInfo count 3,154 (± 0.00%) 3,154 (± 0.00%) 0 ( 0.00%) 3,154 3,154
Req 5 - completionInfo 274ms (± 1.72%) 274ms (± 1.86%) +1ms (+ 0.18%) 267ms 284ms
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)
Benchmark Name Iterations
Current 51771 10
Baseline main 10

Startup

Comparison Report - main..51771
Metric main 51771 Delta Best Worst
tsc-startup - node (v16.17.1, x64)
Execution time 120.92ms (± 0.46%) 117.47ms (± 0.41%) -3.45ms (- 2.85%) 115.37ms 126.01ms
tsserver-startup - node (v16.17.1, x64)
Execution time 200.96ms (± 0.46%) 198.28ms (± 0.40%) -2.69ms (- 1.34%) 194.17ms 212.07ms
tsserverlibrary-startup - node (v16.17.1, x64)
Execution time 195.36ms (± 0.38%) 193.06ms (± 0.43%) -2.30ms (- 1.18%) 189.15ms 200.55ms
typescript-startup - node (v16.17.1, x64)
Execution time 180.67ms (± 0.33%) 178.10ms (± 0.42%) -2.57ms (- 1.42%) 174.51ms 185.35ms
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)
Benchmark Name Iterations
Current 51771 10
Baseline main 10

Developer Information:

Download Benchmark

@typescript-bot
Copy link
Collaborator

@weswigham Here are the results of running the top-repos suite comparing main and refs/pull/51771/merge:

Everything looks good!

const minParams = getMinTypeArgumentCount(params);
const sourceTypes = fillMissingTypeArguments(source.aliasTypeArguments, params, minParams, /*isJs*/ false);
const targetTypes = fillMissingTypeArguments(target.aliasTypeArguments, params, minParams, /*isJs*/ false);
inferFromTypeArguments(sourceTypes, targetTypes!, getAliasVariances(source.aliasSymbol));
Copy link
Member

Choose a reason for hiding this comment

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

Hmm, I wasn't even aware that the type argument list could be incomplete at this point, and I'm not sure that was ever intended. It's fine for type arguments to be missing at the lexical level, but once we're dealing with types we pretty much assume that the length of a type argument list matches the length of the corresponding type parameter list. That assumption is pretty pervasive throughout the compiler (modulo the this type argument that sometimes isn't present). I think it would make more sense to find the origin of the incomplete list and put the call to fillMissingTypeArguments there.

Copy link
Member Author

@weswigham weswigham Dec 8, 2022

Choose a reason for hiding this comment

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

Right, so, our old logic for giving an alias symbol instantiation an alias symbol didn't fill missing type arguments, which is why the new condition I added also didn't - it didn't seem required, since our existing usage didn't fill them. Obviously, broader usage of these unfilled lists reveals the flaw, namely inference (and probably comparison checking) not going well, since, as you said, they currently expect filled lists. Thing is, I think trafficking the unfilled lists has an advantage - it may be worth handling incomplete lists in inference/comparison checking. If we start filling them eagerly, rather than getting the user-supplied list, when we printback, we don't printback the user supplied list anymore. Meaning, even though you wrote Component, we print back and serialize Component<{}, any, any>. For complex defaults, this means we can muddy the printback unnecessarily quite a bit. So while I could fix this by passing in filled lists at the now 2 locations we supply an alias for an alias symbol instantiation, the UX is much nicer if instead we update inference and comparison checking to handle incomplete type alias argument lists, imo.

@weswigham
Copy link
Member Author

@ahejlsberg Rather than ensuring we pass filled lists at every callsite, after an audit, I've ensured we handled unfilled lists everywhere we did comparisons of type alias type argument lists. This is better UX, since then when we printback the aliases, we print them back in the same way the user wrote them (ie, relying on defaults). In either case, there were only 2 places that needing updating. There were 2 places we made lists that needed filling (at a minimum; we make some impromptu aliases out of type references that probably also need filling, but I didn't investigate those too much), but there's also only 2 places we compare alias type argument lists where the list needs to be filled (at most) - inference and variance comparison checking.

src/compiler/checker.ts Show resolved Hide resolved
src/compiler/checker.ts Show resolved Hide resolved
sandersn added a commit to microsoft/DefinitelyTyped-tools that referenced this pull request Dec 14, 2022
1. lambda-tester until microsoft/TypeScript#51771 is merged.
2. aws dependents -- these frequently run out of memory and I want to be notified when that changes without being told that they're failing. They're not failing because of Typescript changes, but because AWS' memory usage is high enough to cause dtslint-runner to cause them to run out of memory.
sandersn added a commit to microsoft/DefinitelyTyped-tools that referenced this pull request Dec 14, 2022
1. lambda-tester until microsoft/TypeScript#51771 is merged.
2. aws dependents -- these frequently run out of memory and I want to be notified when that changes without being told that they're failing. They're not failing because of Typescript changes, but because AWS' memory usage is high enough to cause dtslint-runner to cause them to run out of memory.
@jakebailey jakebailey mentioned this pull request Jan 5, 2023
11 tasks
Copy link
Member

@DanielRosenwasser DanielRosenwasser left a comment

Choose a reason for hiding this comment

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

I think trafficking the unfilled lists has an advantage

I tend to agree with this, though could be persuaded if we forget to do this in so many places that it's a problem. If we want, we can do a follow-up PR that pre-emptively fills type argument defaults, but this seems like a very straightforward fix for now.

@weswigham weswigham merged commit 9da2a9a into microsoft:main Jan 11, 2023
@ahejlsberg
Copy link
Member

Turns out that in most cases we do fill the type parameter defaults early and print them back even if they weren't written explicitly. So, we're basically in an inconsistent state. I think it would make sense to create a separate PR to see what the effect would be of always preserving type references as written.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Author: Team For Milestone Bug PRs that fix a bug with a specific milestone
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

On DT, lambda-tester is broken by better alias preservation
6 participants