Skip to content

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

Merged
Wesley Wigham (weswigham) merged 5 commits into
microsoft:mainfrom
weswigham:fix-alias-inferences-from-defaults
Jan 11, 2023
Merged

Fix inferences between alias type arguments and defaulted alias type arguments#51771
Wesley Wigham (weswigham) merged 5 commits into
microsoft:mainfrom
weswigham:fix-alias-inferences-from-defaults

Conversation

@weswigham

@weswighamWesley Wigham (weswigham) commented Dec 5, 2022

Copy link
Copy Markdown
Member

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~

@weswigham

Copy link
Copy Markdown
MemberAuthor

@typescript-bot

TypeScript Bot (typescript-bot) commented Dec 5, 2022

Copy link
Copy Markdown
Contributor

Heya Wesley Wigham (@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

TypeScript Bot (typescript-bot) commented Dec 5, 2022

Copy link
Copy Markdown
Contributor

Heya Wesley Wigham (@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

TypeScript Bot (typescript-bot) commented Dec 5, 2022

Copy link
Copy Markdown
Contributor

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

@typescript-bot

TypeScript Bot (typescript-bot) commented Dec 5, 2022

Copy link
Copy Markdown
Contributor

Heya Wesley Wigham (@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

TypeScript Bot (typescript-bot) commented Dec 5, 2022

Copy link
Copy Markdown
Contributor

Heya Wesley Wigham (@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

TypeScript Bot (typescript-bot) commented Dec 5, 2022

Copy link
Copy Markdown
Contributor

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

@typescript-bot

TypeScript Bot (typescript-bot) commented Dec 5, 2022

Copy link
Copy Markdown
Contributor

Hey Wesley Wigham (@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
Copy Markdown
Contributor

Wesley Wigham (@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
Copy Markdown
Contributor

Heya Wesley Wigham (@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
Copy Markdown
Contributor

Wesley Wigham (@weswigham)
The results of the perf run you requested are in!

Here they are:

Compiler

Comparison Report - main..51771
Metricmain51771DeltaBestWorst
Angular - node (v18.10.0, x64)
Memory used341,051k (± 0.02%)341,019k (± 0.03%)-31k (- 0.01%)340,788k341,200k
Parse Time1.57s (± 0.66%)1.58s (± 0.90%)+0.01s (+ 0.51%)1.55s1.61s
Bind Time0.52s (± 1.06%)0.52s (± 0.86%)-0.00s (- 0.77%)0.51s0.53s
Check Time4.03s (± 0.86%)4.02s (± 0.48%)-0.01s (- 0.27%)3.98s4.07s
Emit Time4.31s (± 1.36%)4.26s (± 0.37%)-0.05s (- 1.21%)4.23s4.29s
Total Time10.43s (± 0.88%)10.37s (± 0.28%)-0.06s (- 0.59%)10.30s10.41s
Compiler-Unions - node (v18.10.0, x64)
Memory used187,300k (± 1.10%)188,417k (± 1.09%)+1,117k (+ 0.60%)184,978k190,748k
Parse Time0.62s (± 0.48%)0.61s (± 0.73%)-0.01s (- 0.97%)0.60s0.62s
Bind Time0.33s (± 1.04%)0.33s (± 1.12%)-0.00s (- 0.31%)0.32s0.33s
Check Time5.05s (± 0.62%)4.99s (± 0.39%)-0.06s (- 1.13%)4.95s5.04s
Emit Time1.56s (± 1.44%)1.55s (± 0.34%)-0.01s (- 0.83%)1.54s1.56s
Total Time7.55s (± 0.47%)7.47s (± 0.24%)-0.08s (- 1.06%)7.44s7.52s
Monaco - node (v18.10.0, x64)
Memory used320,491k (± 0.02%)320,445k (± 0.02%)-45k (- 0.01%)320,228k320,651k
Parse Time1.16s (± 0.92%)1.14s (± 1.01%)-0.01s (- 1.04%)1.12s1.17s
Bind Time0.49s (± 1.36%)0.49s (± 1.40%)-0.00s (- 0.82%)0.47s0.50s
Check Time3.88s (± 0.41%)3.85s (± 0.79%)-0.03s (- 0.75%)3.81s3.92s
Emit Time2.27s (± 0.65%)2.24s (± 0.83%)-0.03s (- 1.28%)2.22s2.29s
Total Time7.79s (± 0.31%)7.72s (± 0.32%)-0.07s (- 0.86%)7.67s7.77s
TFS - node (v18.10.0, x64)
Memory used283,328k (± 0.20%)282,929k (± 0.02%)-399k (- 0.14%)282,779k283,024k
Parse Time0.96s (± 2.67%)0.95s (± 1.34%)-0.01s (- 1.24%)0.93s0.99s
Bind Time0.46s (± 8.41%)0.46s (± 8.70%)+0.00s (+ 0.22%)0.43s0.58s
Check Time3.81s (± 0.49%)3.80s (± 0.77%)-0.01s (- 0.18%)3.74s3.88s
Emit Time2.23s (± 0.52%)2.20s (± 0.55%)-0.03s (- 1.30%)2.17s2.22s
Total Time7.46s (± 0.51%)7.41s (± 0.72%)-0.05s (- 0.68%)7.33s7.56s
material-ui - node (v18.10.0, x64)
Memory used435,962k (± 0.01%)435,934k (± 0.01%)-27k (- 0.01%)435,877k436,144k
Parse Time1.32s (± 0.69%)1.31s (± 0.51%)-0.01s (- 1.06%)1.29s1.32s
Bind Time0.49s (± 2.57%)0.49s (± 2.13%)-0.00s (- 0.61%)0.45s0.50s
Check Time10.41s (± 0.81%)10.35s (± 0.74%)-0.06s (- 0.53%)10.22s10.52s
Emit Time0.00s (± 0.00%)0.00s (± 0.00%)0.00s ( NaN%)0.00s0.00s
Total Time12.22s (± 0.73%)12.15s (± 0.70%)-0.07s (- 0.57%)12.00s12.33s
xstate - node (v18.10.0, x64)
Memory used518,433k (± 0.01%)518,449k (± 0.01%)+15k (+ 0.00%)518,328k518,612k
Parse Time1.89s (± 0.44%)1.88s (± 0.48%)-0.01s (- 0.48%)1.86s1.90s
Bind Time0.70s (± 2.50%)0.70s (± 2.63%)-0.00s (- 0.14%)0.68s0.75s
Check Time1.05s (± 0.84%)1.04s (± 0.87%)-0.01s (- 0.76%)1.02s1.06s
Emit Time0.05s (± 0.00%)0.05s (± 0.00%)0.00s ( 0.00%)0.05s0.05s
Total Time3.69s (± 0.75%)3.67s (± 0.61%)-0.02s (- 0.54%)3.64s3.72s
Angular - node (v16.17.1, x64)
Memory used340,516k (± 0.01%)340,494k (± 0.02%)-22k (- 0.01%)340,323k340,582k
Parse Time1.87s (± 0.59%)1.85s (± 0.51%)-0.01s (- 0.70%)1.83s1.87s
Bind Time0.65s (± 0.56%)0.65s (± 0.58%)-0.00s (- 0.15%)0.64s0.65s
Check Time5.15s (± 0.55%)5.15s (± 0.63%)-0.00s (- 0.08%)5.10s5.23s
Emit Time5.12s (± 0.99%)5.07s (± 0.42%)-0.04s (- 0.82%)5.02s5.11s
Total Time12.79s (± 0.57%)12.72s (± 0.41%)-0.06s (- 0.49%)12.63s12.84s
Compiler-Unions - node (v16.17.1, x64)
Memory used187,686k (± 0.59%)187,344k (± 0.52%)-342k (- 0.18%)186,626k190,013k
Parse Time0.79s (± 0.92%)0.80s (± 1.12%)+0.00s (+ 0.38%)0.77s0.81s
Bind Time0.42s (± 1.07%)0.42s (± 1.14%)-0.00s (- 0.24%)0.41s0.43s
Check Time6.11s (± 0.43%)6.06s (± 0.61%)-0.05s (- 0.82%)5.99s6.14s
Emit Time1.94s (± 0.54%)1.94s (± 0.45%)0.00s ( 0.00%)1.93s1.96s
Total Time9.27s (± 0.40%)9.22s (± 0.45%)-0.05s (- 0.54%)9.14s9.31s
Monaco - node (v16.17.1, x64)
Memory used319,841k (± 0.05%)319,755k (± 0.01%)-86k (- 0.03%)319,701k319,850k
Parse Time1.41s (± 0.71%)1.41s (± 0.78%)-0.01s (- 0.49%)1.39s1.44s
Bind Time0.59s (± 0.62%)0.59s (± 0.88%)-0.00s (- 0.67%)0.58s0.60s
Check Time4.89s (± 0.44%)4.88s (± 0.37%)-0.01s (- 0.23%)4.82s4.90s
Emit Time2.75s (± 1.16%)2.73s (± 1.08%)-0.02s (- 0.65%)2.69s2.81s
Total Time9.65s (± 0.51%)9.60s (± 0.46%)-0.04s (- 0.46%)9.53s9.70s
TFS - node (v16.17.1, x64)
Memory used282,522k (± 0.16%)282,284k (± 0.01%)-238k (- 0.08%)282,228k282,359k
Parse Time1.16s (± 0.81%)1.16s (± 0.51%)-0.00s (- 0.09%)1.14s1.17s
Bind Time0.66s (± 4.58%)0.64s (± 4.96%)-0.02s (- 2.58%)0.58s0.70s
Check Time4.78s (± 0.43%)4.77s (± 0.40%)-0.01s (- 0.21%)4.73s4.83s
Emit Time2.77s (± 1.75%)2.80s (± 2.13%)+0.03s (+ 1.01%)2.70s2.91s
Total Time9.37s (± 0.70%)9.37s (± 0.78%)-0.00s (- 0.03%)9.24s9.54s
material-ui - node (v16.17.1, x64)
Memory used435,299k (± 0.00%)435,313k (± 0.00%)+14k (+ 0.00%)435,275k435,365k
Parse Time1.63s (± 0.50%)1.62s (± 0.55%)-0.02s (- 1.04%)1.60s1.64s
Bind Time0.51s (± 0.92%)0.50s (± 0.59%)-0.01s (- 1.57%)0.50s0.51s
Check Time11.92s (± 0.67%)11.81s (± 0.51%)-0.11s (- 0.89%)11.68s11.96s
Emit Time0.00s (± 0.00%)0.00s (± 0.00%)0.00s ( NaN%)0.00s0.00s
Total Time14.06s (± 0.60%)13.93s (± 0.50%)-0.13s (- 0.91%)13.80s14.12s
xstate - node (v16.17.1, x64)
Memory used516,012k (± 0.01%)515,986k (± 0.00%)-26k (- 0.01%)515,935k516,052k
Parse Time2.26s (± 0.39%)2.26s (± 0.48%)-0.00s (- 0.09%)2.24s2.29s
Bind Time0.84s (± 1.65%)0.83s (± 2.06%)-0.01s (- 0.84%)0.81s0.89s
Check Time1.36s (± 0.95%)1.36s (± 0.85%)+0.00s (+ 0.00%)1.33s1.38s
Emit Time0.06s (± 0.00%)0.06s (± 0.00%)0.00s ( 0.00%)0.06s0.06s
Total Time4.52s (± 0.46%)4.52s (± 0.56%)-0.00s (- 0.11%)4.47s4.58s
Angular - node (v14.15.1, x64)
Memory used333,994k (± 0.00%)334,002k (± 0.01%)+9k (+ 0.00%)333,930k334,074k
Parse Time2.04s (± 0.81%)2.03s (± 0.43%)-0.01s (- 0.49%)2.02s2.05s
Bind Time0.70s (± 0.74%)0.70s (± 1.94%)+0.00s (+ 0.43%)0.69s0.75s
Check Time5.51s (± 0.42%)5.51s (± 0.48%)+0.00s (+ 0.02%)5.46s5.58s
Emit Time5.42s (± 0.75%)5.35s (± 0.80%)-0.07s (- 1.37%)5.25s5.46s
Total Time13.67s (± 0.47%)13.59s (± 0.49%)-0.08s (- 0.59%)13.45s13.72s
Compiler-Unions - node (v14.15.1, x64)
Memory used182,643k (± 0.64%)183,044k (± 0.68%)+401k (+ 0.22%)181,664k185,137k
Parse Time0.89s (± 0.42%)0.89s (± 1.44%)+0.01s (+ 0.90%)0.88s0.94s
Bind Time0.45s (± 0.66%)0.46s (± 0.80%)+0.00s (+ 0.88%)0.45s0.46s
Check Time6.39s (± 0.75%)6.39s (± 0.69%)+0.00s (+ 0.00%)6.29s6.49s
Emit Time2.05s (± 0.86%)2.05s (± 0.69%)-0.00s (- 0.15%)2.02s2.08s
Total Time9.77s (± 0.58%)9.78s (± 0.59%)+0.01s (+ 0.08%)9.67s9.93s
Monaco - node (v14.15.1, x64)
Memory used314,566k (± 0.01%)314,686k (± 0.05%)+120k (+ 0.04%)314,536k315,316k
Parse Time1.57s (± 0.95%)1.56s (± 0.61%)-0.01s (- 0.89%)1.53s1.57s
Bind Time0.64s (± 0.94%)0.63s (± 0.92%)-0.00s (- 0.31%)0.62s0.65s
Check Time5.23s (± 0.53%)5.20s (± 0.50%)-0.03s (- 0.54%)5.13s5.24s
Emit Time2.90s (± 0.73%)2.88s (± 0.49%)-0.03s (- 0.96%)2.84s2.90s
Total Time10.33s (± 0.57%)10.26s (± 0.31%)-0.07s (- 0.70%)10.19s10.34s
TFS - node (v14.15.1, x64)
Memory used279,373k (± 0.01%)279,388k (± 0.01%)+15k (+ 0.01%)279,335k279,445k
Parse Time1.34s (± 0.97%)1.34s (± 2.25%)-0.01s (- 0.37%)1.28s1.43s
Bind Time0.59s (± 0.38%)0.59s (± 0.38%)0.00s ( 0.00%)0.58s0.59s
Check Time5.12s (± 0.34%)5.10s (± 0.64%)-0.02s (- 0.45%)5.03s5.19s
Emit Time3.13s (± 0.74%)3.08s (± 0.58%)-0.05s (- 1.47%)3.04s3.12s
Total Time10.18s (± 0.31%)10.10s (± 0.43%)-0.08s (- 0.75%)10.00s10.20s
material-ui - node (v14.15.1, x64)
Memory used430,756k (± 0.01%)430,768k (± 0.01%)+12k (+ 0.00%)430,714k430,841k
Parse Time1.86s (± 0.47%)1.85s (± 0.59%)-0.01s (- 0.43%)1.83s1.88s
Bind Time0.54s (± 0.93%)0.53s (± 0.76%)-0.01s (- 1.12%)0.52s0.54s
Check Time12.35s (± 0.75%)12.24s (± 0.56%)-0.12s (- 0.93%)12.07s12.37s
Emit Time0.00s (± 0.00%)0.00s (± 0.00%)0.00s ( NaN%)0.00s0.00s
Total Time14.75s (± 0.66%)14.62s (± 0.51%)-0.13s (- 0.85%)14.44s14.75s
xstate - node (v14.15.1, x64)
Memory used504,343k (± 0.01%)504,394k (± 0.01%)+50k (+ 0.01%)504,199k504,460k
Parse Time2.55s (± 0.37%)2.54s (± 0.34%)-0.01s (- 0.47%)2.52s2.56s
Bind Time0.84s (± 0.73%)0.84s (± 0.57%)-0.00s (- 0.48%)0.83s0.85s
Check Time1.47s (± 0.59%)1.48s (± 0.61%)+0.01s (+ 0.61%)1.47s1.51s
Emit Time0.07s (± 0.00%)0.07s (± 0.00%)0.00s ( 0.00%)0.07s0.07s
Total Time4.93s (± 0.28%)4.93s (± 0.31%)0.00s ( 0.00%)4.91s4.96s
System
Machine Namets-ci-ubuntu
Platformlinux 5.4.0-131-generic
Architecturex64
Available Memory16 GB
Available Memory15 GB
CPUs4 × Intel(R) Core(TM) i7-4770 CPU @ 3.40GHz
Hosts
  • node (v18.10.0, x64)
  • node (v16.17.1, x64)
  • node (v14.15.1, x64)
Scenarios
  • Angular - node (v18.10.0, x64)
  • Angular - node (v16.17.1, x64)
  • Angular - node (v14.15.1, x64)
  • Compiler-Unions - node (v18.10.0, x64)
  • Compiler-Unions - node (v16.17.1, x64)
  • Compiler-Unions - node (v14.15.1, x64)
  • Monaco - node (v18.10.0, x64)
  • Monaco - node (v16.17.1, x64)
  • Monaco - node (v14.15.1, x64)
  • TFS - node (v18.10.0, x64)
  • TFS - node (v16.17.1, x64)
  • TFS - node (v14.15.1, x64)
  • material-ui - node (v18.10.0, x64)
  • material-ui - node (v16.17.1, x64)
  • material-ui - node (v14.15.1, x64)
  • xstate - node (v18.10.0, x64)
  • xstate - node (v16.17.1, x64)
  • xstate - node (v14.15.1, x64)
BenchmarkNameIterations
Current5177110
Baselinemain10

TSServer

Comparison Report - main..51771
Metricmain51771DeltaBestWorst
Compiler-UnionsTSServer - node (v18.10.0, x64)
Req 1 - updateOpen1,053ms (± 0.68%)1,047ms (± 0.43%)-6ms (- 0.57%)1,038ms1,059ms
Req 2 - geterr2,594ms (± 0.88%)2,581ms (± 0.67%)-13ms (- 0.49%)2,540ms2,623ms
Req 3 - references166ms (± 0.54%)165ms (± 0.70%)-0ms (- 0.18%)163ms168ms
Req 4 - navto139ms (± 0.59%)139ms (± 0.75%)+0ms (+ 0.07%)137ms142ms
Req 5 - completionInfo count1,356 (± 0.00%)1,356 (± 0.00%)0 ( 0.00%)1,3561,356
Req 5 - completionInfo60ms (± 3.02%)61ms (± 2.93%)+1ms (+ 1.16%)54ms63ms
CompilerTSServer - node (v18.10.0, x64)
Req 1 - updateOpen1,114ms (± 0.58%)1,102ms (± 0.90%)-12ms (- 1.10%)1,083ms1,125ms
Req 2 - geterr1,614ms (± 0.75%)1,602ms (± 0.92%)-13ms (- 0.79%)1,579ms1,638ms
Req 3 - references169ms (± 0.68%)169ms (± 0.65%)-0ms (- 0.18%)167ms172ms
Req 4 - navto152ms (± 0.58%)151ms (± 0.86%)-2ms (- 1.12%)148ms153ms
Req 5 - completionInfo count1,518 (± 0.00%)1,518 (± 0.00%)0 ( 0.00%)1,5181,518
Req 5 - completionInfo54ms (± 1.61%)52ms (± 1.85%)🟩-2ms (- 3.16%)51ms55ms
xstateTSServer - node (v18.10.0, x64)
Req 1 - updateOpen1,510ms (± 0.76%)1,501ms (± 0.75%)-10ms (- 0.65%)1,483ms1,523ms
Req 2 - geterr559ms (± 0.77%)557ms (± 0.80%)-2ms (- 0.30%)548ms569ms
Req 3 - references59ms (± 2.39%)59ms (± 3.63%)+0ms (+ 0.68%)57ms67ms
Req 4 - navto197ms (± 1.09%)196ms (± 0.84%)-1ms (- 0.36%)194ms200ms
Req 5 - completionInfo count3,154 (± 0.00%)3,154 (± 0.00%)0 ( 0.00%)3,1543,154
Req 5 - completionInfo213ms (± 0.87%)211ms (± 0.81%)-2ms (- 1.03%)208ms215ms
Compiler-UnionsTSServer - node (v16.17.1, x64)
Req 1 - updateOpen1,306ms (± 0.60%)1,305ms (± 0.70%)-1ms (- 0.11%)1,285ms1,322ms
Req 2 - geterr3,235ms (± 0.53%)3,220ms (± 0.79%)-15ms (- 0.47%)3,178ms3,275ms
Req 3 - references191ms (± 0.53%)192ms (± 0.78%)+1ms (+ 0.42%)190ms195ms
Req 4 - navto151ms (± 0.83%)150ms (± 1.01%)-1ms (- 0.46%)148ms154ms
Req 5 - completionInfo count1,356 (± 0.00%)1,356 (± 0.00%)0 ( 0.00%)1,3561,356
Req 5 - completionInfo63ms (± 5.97%)61ms (± 4.01%)-1ms (- 2.24%)58ms70ms
CompilerTSServer - node (v16.17.1, x64)
Req 1 - updateOpen1,400ms (± 0.70%)1,387ms (± 1.06%)-12ms (- 0.88%)1,361ms1,413ms
Req 2 - geterr2,117ms (± 0.45%)2,114ms (± 0.70%)-3ms (- 0.16%)2,077ms2,134ms
Req 3 - references199ms (± 0.67%)198ms (± 0.63%)-1ms (- 0.45%)196ms201ms
Req 4 - navto165ms (± 0.99%)165ms (± 0.97%)+0ms (+ 0.18%)161ms168ms
Req 5 - completionInfo count1,518 (± 0.00%)1,518 (± 0.00%)0 ( 0.00%)1,5181,518
Req 5 - completionInfo58ms (± 2.95%)56ms (± 1.08%)🟩-3ms (- 4.64%)54ms57ms
xstateTSServer - node (v16.17.1, x64)
Req 1 - updateOpen1,817ms (± 0.76%)1,812ms (± 0.54%)-5ms (- 0.29%)1,795ms1,836ms
Req 2 - geterr723ms (± 0.88%)721ms (± 0.57%)-2ms (- 0.28%)709ms729ms
Req 3 - references67ms (± 1.05%)68ms (± 1.23%)+1ms (+ 0.90%)66ms70ms
Req 4 - navto199ms (± 0.85%)198ms (± 0.81%)-1ms (- 0.40%)194ms202ms
Req 5 - completionInfo count3,154 (± 0.00%)3,154 (± 0.00%)0 ( 0.00%)3,1543,154
Req 5 - completionInfo256ms (± 1.32%)255ms (± 0.64%)-1ms (- 0.43%)252ms259ms
Compiler-UnionsTSServer - node (v14.15.1, x64)
Req 1 - updateOpen1,457ms (± 0.60%)1,449ms (± 0.41%)-8ms (- 0.53%)1,434ms1,459ms
Req 2 - geterr3,457ms (± 0.95%)3,439ms (± 0.96%)-19ms (- 0.54%)3,390ms3,513ms
Req 3 - references207ms (± 0.57%)205ms (± 0.49%)-2ms (- 0.87%)203ms208ms
Req 4 - navto163ms (± 1.20%)162ms (± 0.96%)-1ms (- 0.31%)159ms166ms
Req 5 - completionInfo count1,356 (± 0.00%)1,356 (± 0.00%)0 ( 0.00%)1,3561,356
Req 5 - completionInfo57ms (± 0.83%)57ms (± 0.91%)-0ms (- 0.35%)56ms58ms
CompilerTSServer - node (v14.15.1, x64)
Req 1 - updateOpen1,529ms (± 0.42%)1,524ms (± 0.51%)-5ms (- 0.35%)1,512ms1,549ms
Req 2 - geterr2,300ms (± 0.62%)2,302ms (± 0.64%)+2ms (+ 0.07%)2,271ms2,336ms
Req 3 - references217ms (± 0.88%)218ms (± 1.20%)+2ms (+ 0.69%)212ms224ms
Req 4 - navto175ms (± 0.77%)173ms (± 0.92%)-1ms (- 0.74%)170ms176ms
Req 5 - completionInfo count1,518 (± 0.00%)1,518 (± 0.00%)0 ( 0.00%)1,5181,518
Req 5 - completionInfo56ms (± 1.38%)56ms (± 0.85%)-0ms (- 0.71%)55ms57ms
xstateTSServer - node (v14.15.1, x64)
Req 1 - updateOpen2,015ms (± 0.94%)2,000ms (± 0.31%)-15ms (- 0.74%)1,987ms2,016ms
Req 2 - geterr746ms (± 0.45%)743ms (± 0.31%)-3ms (- 0.36%)738ms749ms
Req 3 - references73ms (± 1.19%)73ms (± 1.19%)0ms ( 0.00%)72ms75ms
Req 4 - navto218ms (± 0.59%)219ms (± 1.17%)+0ms (+ 0.14%)211ms224ms
Req 5 - completionInfo count3,154 (± 0.00%)3,154 (± 0.00%)0 ( 0.00%)3,1543,154
Req 5 - completionInfo274ms (± 1.72%)274ms (± 1.86%)+1ms (+ 0.18%)267ms284ms
System
Machine Namets-ci-ubuntu
Platformlinux 5.4.0-131-generic
Architecturex64
Available Memory16 GB
Available Memory15 GB
CPUs4 × Intel(R) Core(TM) i7-4770 CPU @ 3.40GHz
Hosts
  • node (v18.10.0, x64)
  • node (v16.17.1, x64)
  • node (v14.15.1, x64)
Scenarios
  • Compiler-UnionsTSServer - node (v18.10.0, x64)
  • Compiler-UnionsTSServer - node (v16.17.1, x64)
  • Compiler-UnionsTSServer - node (v14.15.1, x64)
  • CompilerTSServer - node (v18.10.0, x64)
  • CompilerTSServer - node (v16.17.1, x64)
  • CompilerTSServer - node (v14.15.1, x64)
  • xstateTSServer - node (v18.10.0, x64)
  • xstateTSServer - node (v16.17.1, x64)
  • xstateTSServer - node (v14.15.1, x64)
BenchmarkNameIterations
Current5177110
Baselinemain10

Startup

Comparison Report - main..51771
Metricmain51771DeltaBestWorst
tsc-startup - node (v16.17.1, x64)
Execution time120.92ms (± 0.46%)117.47ms (± 0.41%)-3.45ms (- 2.85%)115.37ms126.01ms
tsserver-startup - node (v16.17.1, x64)
Execution time200.96ms (± 0.46%)198.28ms (± 0.40%)-2.69ms (- 1.34%)194.17ms212.07ms
tsserverlibrary-startup - node (v16.17.1, x64)
Execution time195.36ms (± 0.38%)193.06ms (± 0.43%)-2.30ms (- 1.18%)189.15ms200.55ms
typescript-startup - node (v16.17.1, x64)
Execution time180.67ms (± 0.33%)178.10ms (± 0.42%)-2.57ms (- 1.42%)174.51ms185.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)
BenchmarkNameIterations
Current5177110
Baselinemain10

Developer Information:

Download Benchmark

@typescript-bot

Copy link
Copy Markdown
Contributor

Wesley Wigham (@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
Copy Markdown
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.

@weswighamWesley Wigham (weswigham)Dec 8, 2022

Copy link
Copy Markdown
MemberAuthor

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
Copy Markdown
MemberAuthor

Anders Hejlsberg (@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.

Comment threadsrc/compiler/checker.ts
Comment threadsrc/compiler/checker.ts
Nathan Shively-Sanders (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.
Nathan Shively-Sanders (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.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I 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
Wesley Wigham (weswigham) merged commit 9da2a9a into microsoft:mainJan 11, 2023
@ahejlsberg

Copy link
Copy Markdown
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 freeto subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Author: TeamFor Milestone BugPRs 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

@weswigham@typescript-bot@ahejlsberg@JoostK@sandersn@DanielRosenwasser