Skip to content

Improve logic that chooses co- vs. contra-variant inferences - #52123

Merged
Anders Hejlsberg (ahejlsberg) merged 2 commits into
mainfrom
fix52111
Jan 6, 2023
Merged

Improve logic that chooses co- vs. contra-variant inferences#52123
Anders Hejlsberg (ahejlsberg) merged 2 commits into
mainfrom
fix52111

Conversation

@ahejlsberg

Copy link
Copy Markdown
Member

Fixes#52111.

@jakebailey

Copy link
Copy Markdown
Member

@typescript-bot

TypeScript Bot (typescript-bot) commented Jan 6, 2023

Copy link
Copy Markdown
Contributor

Heya Jake Bailey (@jakebailey), I've started to run the tarball bundle task on this PR at 26902df. You can monitor the build here.

@typescript-bot

TypeScript Bot (typescript-bot) commented Jan 6, 2023

Copy link
Copy Markdown
Contributor

Heya Jake Bailey (@jakebailey), I've started to run the parallelized Definitely Typed test suite on this PR at 26902df. You can monitor the build here.

@typescript-bot

TypeScript Bot (typescript-bot) commented Jan 6, 2023

Copy link
Copy Markdown
Contributor

Heya Jake Bailey (@jakebailey), I've started to run the extended test suite on this PR at 26902df. You can monitor the build here.

@typescript-bot

TypeScript Bot (typescript-bot) commented Jan 6, 2023

Copy link
Copy Markdown
Contributor

Heya Jake Bailey (@jakebailey), I've started to run the diff-based user code test suite on this PR at 26902df. You can monitor the build here.

Update: The results are in!

@typescript-bot

TypeScript Bot (typescript-bot) commented Jan 6, 2023

Copy link
Copy Markdown
Contributor

Heya Jake Bailey (@jakebailey), I've started to run the perf test suite on this PR at 26902df. You can monitor the build here.

Update: The results are in!

@typescript-bot

TypeScript Bot (typescript-bot) commented Jan 6, 2023

Copy link
Copy Markdown
Contributor

Heya Jake Bailey (@jakebailey), I've started to run the diff-based top-repos suite on this PR at 26902df. You can monitor the build here.

Update: The results are in!

@typescript-bot

TypeScript Bot (typescript-bot) commented Jan 6, 2023

Copy link
Copy Markdown
Contributor

Hey Jake Bailey (@jakebailey), 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/141820/artifacts?artifactName=tgz&fileId=571630FA0136B72F65125DEE199C24B9DB867FD2DFDC575B2F67317C7ED5F5C102&fileName=/typescript-5.0.0-insiders.20230106.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-52123-7".;

@jakebailey

Copy link
Copy Markdown
Member

I can confirm that this fixes all of my cast/assert issues on the SFT branch. Wonderful!

@typescript-bot

Copy link
Copy Markdown
Contributor

Jake Bailey (@jakebailey) Here are the results of running the user test suite comparing main and refs/pull/52123/merge:

Everything looks good!

@typescript-bot

Copy link
Copy Markdown
Contributor

Heya Jake Bailey (@jakebailey), 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

Jake Bailey (@jakebailey) Here are the results of running the top-repos suite comparing main and refs/pull/52123/merge:

Everything looks good!

@typescript-bot

Copy link
Copy Markdown
Contributor

Jake Bailey (@jakebailey)
The results of the perf run you requested are in!

Here they are:

Compiler

Comparison Report - main..52123
Metricmain52123DeltaBestWorst
Angular - node (v18.10.0, x64)
Memory used372,656k (± 0.01%)372,647k (± 0.01%)-9k (- 0.00%)372,574k372,722k
Parse Time3.96s (± 0.66%)3.95s (± 0.82%)-0.01s (- 0.17%)3.91s3.99s
Bind Time1.20s (± 1.12%)1.20s (± 1.39%)+0.00s (+ 0.12%)1.18s1.22s
Check Time8.58s (± 0.52%)8.61s (± 0.50%)+0.03s (+ 0.39%)8.54s8.66s
Emit Time7.55s (± 0.73%)7.53s (± 1.05%)-0.02s (- 0.30%)7.46s7.68s
Total Time21.29s (± 0.47%)21.30s (± 0.34%)+0.01s (+ 0.03%)21.20s21.37s
Compiler-Unions - node (v18.10.0, x64)
Memory used199,315k (± 1.16%)199,326k (± 1.20%)+11k (+ 0.01%)198,311k204,208k
Parse Time1.64s (± 0.81%)1.65s (± 1.09%)+0.01s (+ 0.81%)1.62s1.67s
Bind Time0.79s (± 0.70%)0.79s (± 0.66%)-0.00s (- 0.21%)0.79s0.80s
Check Time9.47s (± 0.43%)9.51s (± 0.41%)+0.05s (+ 0.49%)9.44s9.56s
Emit Time2.75s (± 1.00%)2.76s (± 1.06%)+0.01s (+ 0.55%)2.72s2.80s
Total Time14.64s (± 0.34%)14.71s (± 0.31%)+0.07s (+ 0.49%)14.64s14.78s
Monaco - node (v18.10.0, x64)
Memory used354,086k (± 0.02%)354,085k (± 0.01%)-1k (- 0.00%)354,039k354,133k
Parse Time2.97s (± 1.00%)2.96s (± 0.79%)-0.02s (- 0.57%)2.92s2.99s
Bind Time1.05s (± 0.86%)1.04s (± 1.37%)-0.01s (- 0.54%)1.03s1.07s
Check Time7.22s (± 0.38%)7.23s (± 0.40%)+0.01s (+ 0.12%)7.19s7.27s
Emit Time4.27s (± 1.06%)4.23s (± 0.22%)-0.04s (- 1.04%)4.21s4.24s
Total Time15.51s (± 0.45%)15.46s (± 0.20%)-0.06s (- 0.36%)15.41s15.50s
TFS - node (v18.10.0, x64)
Memory used310,033k (± 0.00%)310,021k (± 0.01%)-13k (- 0.00%)309,992k310,042k
Parse Time2.26s (± 0.93%)2.26s (± 1.21%)+0.00s (+ 0.00%)2.22s2.30s
Bind Time1.16s (± 0.74%)1.16s (± 0.69%)+0.00s (+ 0.14%)1.15s1.17s
Check Time6.80s (± 0.49%)6.79s (± 0.49%)-0.01s (- 0.12%)6.75s6.85s
Emit Time3.92s (± 0.73%)3.90s (± 0.36%)-0.01s (- 0.38%)3.88s3.91s
Total Time14.13s (± 0.32%)14.10s (± 0.32%)-0.02s (- 0.15%)14.06s14.18s
material-ui - node (v18.10.0, x64)
Memory used485,238k (± 0.01%)485,221k (± 0.01%)-17k (- 0.00%)485,180k485,300k
Parse Time3.52s (± 0.32%)3.53s (± 0.59%)+0.01s (+ 0.41%)3.50s3.56s
Bind Time0.96s (± 0.93%)0.97s (± 0.96%)+0.00s (+ 0.45%)0.95s0.97s
Check Time16.91s (± 0.26%)16.93s (± 0.67%)+0.02s (+ 0.14%)16.76s17.07s
Emit Time0.00s (± 0.00%)0.00s (± 0.00%)0.00s ( NaN%)0.00s0.00s
Total Time21.38s (± 0.21%)21.43s (± 0.57%)+0.05s (+ 0.21%)21.27s21.59s
xstate - node (v18.10.0, x64)
Memory used570,392k (± 0.02%)570,241k (± 0.03%)-151k (- 0.03%)570,089k570,489k
Parse Time4.41s (± 0.52%)4.43s (± 0.58%)+0.02s (+ 0.39%)4.40s4.47s
Bind Time1.69s (± 1.61%)1.71s (± 0.54%)+0.02s (+ 0.94%)1.70s1.72s
Check Time2.60s (± 0.54%)2.60s (± 0.86%)-0.01s (- 0.20%)2.57s2.63s
Emit Time0.08s (± 0.17%)0.08s (± 0.20%)-0.00s (- 0.13%)0.08s0.08s
Total Time8.80s (± 0.41%)8.82s (± 0.28%)+0.02s (+ 0.24%)8.79s8.86s
Angular - node (v16.17.1, x64)
Memory used372,007k (± 0.01%)371,978k (± 0.01%)-29k (- 0.01%)371,924k372,021k
Parse Time4.13s (± 0.32%)4.15s (± 0.87%)+0.03s (+ 0.63%)4.12s4.21s
Bind Time1.27s (± 0.55%)1.27s (± 0.96%)+0.00s (+ 0.10%)1.25s1.28s
Check Time9.31s (± 0.52%)9.29s (± 0.40%)-0.02s (- 0.22%)9.23s9.34s
Emit Time8.03s (± 0.55%)8.01s (± 0.28%)-0.02s (- 0.25%)7.99s8.04s
Total Time22.74s (± 0.12%)22.72s (± 0.26%)-0.01s (- 0.05%)22.65s22.81s
Compiler-Unions - node (v16.17.1, x64)
Memory used200,590k (± 0.64%)201,106k (± 0.86%)+516k (+ 0.26%)199,946k203,457k
Parse Time1.81s (± 0.57%)1.81s (± 0.58%)-0.00s (- 0.09%)1.80s1.83s
Bind Time0.84s (± 1.22%)0.84s (± 1.22%)-0.00s (- 0.00%)0.83s0.86s
Check Time10.12s (± 1.29%)10.04s (± 0.58%)-0.08s (- 0.82%)9.95s10.10s
Emit Time2.99s (± 1.21%)2.98s (± 1.11%)-0.01s (- 0.22%)2.93s3.03s
Total Time15.76s (± 1.06%)15.67s (± 0.51%)-0.09s (- 0.60%)15.53s15.74s
Monaco - node (v16.17.1, x64)
Memory used353,413k (± 0.01%)353,393k (± 0.01%)-20k (- 0.01%)353,356k353,435k
Parse Time3.17s (± 0.54%)3.17s (± 0.55%)+0.00s (+ 0.04%)3.14s3.19s
Bind Time1.13s (± 1.34%)1.13s (± 1.24%)+0.00s (+ 0.38%)1.12s1.15s
Check Time7.85s (± 0.45%)7.86s (± 0.62%)+0.01s (+ 0.12%)7.77s7.92s
Emit Time4.49s (± 0.49%)4.48s (± 0.41%)-0.01s (- 0.18%)4.47s4.52s
Total Time16.63s (± 0.18%)16.64s (± 0.28%)+0.01s (+ 0.08%)16.58s16.70s
TFS - node (v16.17.1, x64)
Memory used309,368k (± 0.00%)309,375k (± 0.01%)+7k (+ 0.00%)309,354k309,401k
Parse Time2.60s (± 1.08%)2.60s (± 1.39%)-0.01s (- 0.22%)2.55s2.65s
Bind Time1.07s (± 2.18%)1.07s (± 1.57%)-0.00s (- 0.06%)1.05s1.10s
Check Time7.39s (± 0.50%)7.41s (± 0.38%)+0.01s (+ 0.19%)7.37s7.45s
Emit Time4.19s (± 0.49%)4.22s (± 0.44%)+0.02s (+ 0.53%)4.19s4.24s
Total Time15.26s (± 0.33%)15.29s (± 0.38%)+0.03s (+ 0.20%)15.24s15.39s
material-ui - node (v16.17.1, x64)
Memory used484,506k (± 0.00%)484,506k (± 0.00%)+1k (+ 0.00%)484,486k484,531k
Parse Time3.67s (± 0.35%)3.67s (± 0.31%)+0.00s (+ 0.00%)3.67s3.70s
Bind Time1.01s (± 0.47%)1.01s (± 0.38%)+0.00s (+ 0.36%)1.01s1.02s
Check Time17.85s (± 0.25%)17.83s (± 0.32%)-0.02s (- 0.12%)17.77s17.93s
Emit Time0.00s (± 0.00%)0.00s (± 0.00%)0.00s ( NaN%)0.00s0.00s
Total Time22.54s (± 0.22%)22.52s (± 0.26%)-0.01s (- 0.06%)22.46s22.63s
xstate - node (v16.17.1, x64)
Memory used567,851k (± 0.02%)567,821k (± 0.02%)-30k (- 0.01%)567,705k567,932k
Parse Time4.75s (± 0.34%)4.76s (± 0.24%)+0.02s (+ 0.34%)4.74s4.77s
Bind Time1.65s (± 0.61%)1.66s (± 0.46%)+0.01s (+ 0.54%)1.64s1.67s
Check Time2.83s (± 0.51%)2.83s (± 0.60%)+0.00s (+ 0.01%)2.80s2.85s
Emit Time0.09s (± 0.16%)0.09s (± 0.16%)+0.00s (+ 0.13%)0.09s0.09s
Total Time9.31s (± 0.30%)9.34s (± 0.21%)+0.03s (+ 0.33%)9.31s9.36s
Angular - node (v14.15.1, x64)
Memory used365,663k (± 0.00%)365,647k (± 0.00%)-16k (- 0.00%)365,637k365,654k
Parse Time4.15s (± 0.91%)4.15s (± 0.61%)+0.00s (+ 0.07%)4.12s4.19s
Bind Time1.30s (± 0.65%)1.30s (± 0.60%)+0.00s (+ 0.16%)1.30s1.32s
Check Time9.68s (± 0.51%)9.68s (± 0.51%)-0.01s (- 0.05%)9.62s9.76s
Emit Time8.20s (± 0.55%)8.22s (± 0.85%)+0.02s (+ 0.24%)8.14s8.30s
Total Time23.34s (± 0.30%)23.36s (± 0.48%)+0.01s (+ 0.06%)23.23s23.48s
Compiler-Unions - node (v14.15.1, x64)
Memory used195,146k (± 0.02%)195,158k (± 0.02%)+13k (+ 0.01%)195,120k195,215k
Parse Time1.85s (± 0.37%)1.84s (± 0.54%)-0.00s (- 0.22%)1.83s1.86s
Bind Time0.87s (± 0.52%)0.87s (± 0.63%)-0.00s (- 0.32%)0.87s0.88s
Check Time10.15s (± 0.84%)10.15s (± 0.52%)-0.00s (- 0.04%)10.09s10.22s
Emit Time3.13s (± 0.71%)3.13s (± 0.93%)+0.00s (+ 0.13%)3.08s3.16s
Total Time16.00s (± 0.41%)16.00s (± 0.39%)-0.01s (- 0.04%)15.93s16.08s
Monaco - node (v14.15.1, x64)
Memory used348,245k (± 0.01%)348,242k (± 0.01%)-3k (- 0.00%)348,189k348,281k
Parse Time3.22s (± 1.14%)3.27s (± 0.51%)+0.04s (+ 1.30%)3.24s3.28s
Bind Time1.12s (± 0.59%)1.12s (± 0.39%)-0.00s (- 0.08%)1.12s1.13s
Check Time8.15s (± 0.23%)8.16s (± 0.55%)+0.01s (+ 0.11%)8.11s8.22s
Emit Time4.70s (± 0.67%)4.70s (± 0.67%)-0.00s (- 0.04%)4.66s4.75s
Total Time17.19s (± 0.41%)17.25s (± 0.38%)+0.05s (+ 0.32%)17.19s17.34s
TFS - node (v14.15.1, x64)
Memory used304,287k (± 0.01%)304,291k (± 0.00%)+4k (+ 0.00%)304,275k304,309k
Parse Time2.72s (± 0.30%)2.72s (± 1.14%)-0.00s (- 0.05%)2.67s2.75s
Bind Time1.08s (± 0.55%)1.08s (± 0.71%)+0.00s (+ 0.37%)1.07s1.09s
Check Time7.69s (± 0.45%)7.71s (± 0.67%)+0.03s (+ 0.37%)7.62s7.77s
Emit Time4.55s (± 0.94%)4.58s (± 0.75%)+0.02s (+ 0.50%)4.52s4.62s
Total Time16.04s (± 0.39%)16.09s (± 0.17%)+0.05s (+ 0.30%)16.04s16.13s
material-ui - node (v14.15.1, x64)
Memory used479,942k (± 0.01%)479,941k (± 0.00%)-1k (- 0.00%)479,911k479,967k
Parse Time3.89s (± 0.80%)3.89s (± 0.60%)+0.01s (+ 0.22%)3.87s3.92s
Bind Time1.04s (± 0.74%)1.05s (± 0.83%)+0.00s (+ 0.31%)1.03s1.06s
Check Time18.99s (± 0.58%)18.83s (± 0.77%)-0.15s (- 0.81%)18.62s18.99s
Emit Time0.00s (± 0.00%)0.00s (± 0.00%)0.00s ( NaN%)0.00s0.00s
Total Time23.92s (± 0.41%)23.78s (± 0.73%)-0.15s (- 0.61%)23.51s23.98s
xstate - node (v14.15.1, x64)
Memory used556,177k (± 0.00%)556,181k (± 0.01%)+4k (+ 0.00%)556,121k556,221k
Parse Time5.14s (± 0.72%)5.11s (± 0.60%)-0.03s (- 0.59%)5.06s5.14s
Bind Time1.58s (± 0.77%)1.59s (± 0.91%)+0.01s (+ 0.54%)1.57s1.61s
Check Time2.99s (± 0.55%)2.99s (± 0.53%)+0.00s (+ 0.13%)2.97s3.02s
Emit Time0.10s (± 0.08%)0.10s (± 0.08%)-0.00s (- 0.20%)0.10s0.10s
Total Time9.81s (± 0.47%)9.79s (± 0.49%)-0.02s (- 0.17%)9.71s9.85s
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)
BenchmarkNameIterations
Current521236
Baselinemain6

TSServer

Comparison Report - main..52123
Metricmain52123DeltaBestWorst
Compiler-UnionsTSServer - node (v18.10.0, x64)
Req 1 - updateOpen2,540ms (± 1.47%)2,553ms (± 2.14%)+12ms (+ 0.49%)2,478ms2,632ms
Req 2 - geterr5,368ms (± 0.91%)5,384ms (± 1.60%)+17ms (+ 0.31%)5,293ms5,542ms
Req 3 - references369ms (± 0.64%)366ms (± 2.16%)-3ms (- 0.78%)354ms371ms
Req 4 - navto282ms (± 2.49%)288ms (± 3.70%)+6ms (+ 2.00%)276ms300ms
Req 5 - completionInfo count1,356 (± 0.00%)1,356 (± 0.00%)0 ( 0.00%)1,3561,356
Req 5 - completionInfo300ms (± 3.08%)265ms (±33.49%)🟩-35ms (-11.81%)84ms310ms
CompilerTSServer - node (v18.10.0, x64)
Req 1 - updateOpen2,728ms (± 1.41%)2,766ms (± 0.48%)+38ms (+ 1.41%)2,748ms2,784ms
Req 2 - geterr3,960ms (± 0.67%)3,968ms (± 0.66%)+8ms (+ 0.21%)3,940ms4,014ms
Req 3 - references361ms (± 1.20%)361ms (± 0.71%)+1ms (+ 0.15%)358ms364ms
Req 4 - navto289ms (± 1.06%)290ms (± 1.37%)+1ms (+ 0.18%)284ms296ms
Req 5 - completionInfo count1,518 (± 0.00%)1,518 (± 0.00%)0 ( 0.00%)1,5181,518
Req 5 - completionInfo68ms (± 4.18%)69ms (± 4.39%)+0ms (+ 0.29%)65ms73ms
xstateTSServer - node (v18.10.0, x64)
Req 1 - updateOpen3,391ms (± 0.69%)3,378ms (± 0.70%)-12ms (- 0.36%)3,339ms3,410ms
Req 2 - geterr1,550ms (± 1.16%)1,540ms (± 0.81%)-10ms (- 0.64%)1,529ms1,559ms
Req 3 - references109ms (± 1.54%)108ms (± 1.75%)-1ms (- 1.28%)105ms110ms
Req 4 - navto359ms (± 1.20%)358ms (± 1.18%)-1ms (- 0.26%)354ms364ms
Req 5 - completionInfo count3,154 (± 0.00%)3,154 (± 0.00%)0 ( 0.00%)3,1543,154
Req 5 - completionInfo434ms (± 1.90%)438ms (± 0.95%)+4ms (+ 0.86%)433ms445ms
Compiler-UnionsTSServer - node (v16.17.1, x64)
Req 1 - updateOpen2,778ms (± 0.29%)2,753ms (± 0.82%)-25ms (- 0.89%)2,724ms2,780ms
Req 2 - geterr5,775ms (± 1.67%)5,884ms (± 1.74%)+110ms (+ 1.90%)5,690ms5,976ms
Req 3 - references370ms (± 1.69%)361ms (± 0.94%)-9ms (- 2.52%)356ms366ms
Req 4 - navto281ms (± 1.46%)283ms (± 1.83%)+2ms (+ 0.57%)278ms291ms
Req 5 - completionInfo count1,356 (± 0.00%)1,356 (± 0.00%)0 ( 0.00%)1,3561,356
Req 5 - completionInfo282ms (±33.59%)130ms (±71.13%)🟩-151ms (-53.75%)90ms320ms
CompilerTSServer - node (v16.17.1, x64)
Req 1 - updateOpen2,911ms (± 0.66%)2,924ms (± 0.49%)+13ms (+ 0.43%)2,906ms2,946ms
Req 2 - geterr4,312ms (± 0.35%)4,291ms (± 0.52%)-21ms (- 0.48%)4,262ms4,320ms
Req 3 - references378ms (± 0.48%)377ms (± 0.65%)-1ms (- 0.39%)373ms379ms
Req 4 - navto301ms (± 0.55%)302ms (± 1.42%)+1ms (+ 0.40%)299ms310ms
Req 5 - completionInfo count1,518 (± 0.00%)1,518 (± 0.00%)0 ( 0.00%)1,5181,518
Req 5 - completionInfo274ms (±35.85%)314ms (± 0.84%)+40ms (+14.47%)311ms318ms
xstateTSServer - node (v16.17.1, x64)
Req 1 - updateOpen3,768ms (± 0.21%)3,755ms (± 0.61%)-13ms (- 0.35%)3,726ms3,796ms
Req 2 - geterr1,467ms (± 1.33%)1,452ms (± 0.90%)-16ms (- 1.06%)1,432ms1,469ms
Req 3 - references112ms (± 3.57%)112ms (± 3.66%)+0ms (+ 0.02%)108ms118ms
Req 4 - navto344ms (± 1.97%)346ms (± 3.02%)+3ms (+ 0.77%)336ms363ms
Req 5 - completionInfo count3,154 (± 0.00%)3,154 (± 0.00%)0 ( 0.00%)3,1543,154
Req 5 - completionInfo463ms (± 1.89%)462ms (± 1.52%)-0ms (- 0.10%)456ms472ms
Compiler-UnionsTSServer - node (v14.15.1, x64)
Req 1 - updateOpen2,880ms (± 0.28%)2,890ms (± 0.72%)+11ms (+ 0.37%)2,866ms2,919ms
Req 2 - geterr6,112ms (± 0.75%)6,135ms (± 0.93%)+22ms (+ 0.37%)6,068ms6,214ms
Req 3 - references383ms (± 1.11%)384ms (± 1.27%)+2ms (+ 0.44%)379ms393ms
Req 4 - navto290ms (± 1.05%)292ms (± 0.67%)+2ms (+ 0.73%)290ms295ms
Req 5 - completionInfo count1,356 (± 0.00%)1,356 (± 0.00%)0 ( 0.00%)1,3561,356
Req 5 - completionInfo163ms (±73.80%)323ms (± 1.05%)🔻+160ms (+98.03%)320ms328ms
CompilerTSServer - node (v14.15.1, x64)
Req 1 - updateOpen3,042ms (± 1.00%)3,019ms (± 0.73%)-23ms (- 0.76%)2,993ms3,054ms
Req 2 - geterr4,583ms (± 0.70%)4,542ms (± 0.89%)-41ms (- 0.90%)4,485ms4,586ms
Req 3 - references404ms (± 0.97%)403ms (± 0.82%)-1ms (- 0.21%)399ms408ms
Req 4 - navto308ms (± 1.19%)306ms (± 0.66%)-2ms (- 0.79%)304ms308ms
Req 5 - completionInfo count1,518 (± 0.00%)1,518 (± 0.00%)0 ( 0.00%)1,5181,518
Req 5 - completionInfo86ms (±10.30%)83ms (± 6.93%)-2ms (- 2.86%)76ms91ms
xstateTSServer - node (v14.15.1, x64)
Req 1 - updateOpen3,865ms (± 0.89%)3,876ms (± 0.51%)+11ms (+ 0.29%)3,841ms3,901ms
Req 2 - geterr1,458ms (± 1.05%)1,469ms (± 1.14%)+10ms (+ 0.71%)1,452ms1,495ms
Req 3 - references131ms (± 1.74%)134ms (± 1.26%)+2ms (+ 1.67%)131ms135ms
Req 4 - navto391ms (± 1.07%)398ms (± 1.33%)+7ms (+ 1.77%)392ms406ms
Req 5 - completionInfo count3,154 (± 0.00%)3,154 (± 0.00%)0 ( 0.00%)3,1543,154
Req 5 - completionInfo501ms (± 1.53%)496ms (± 1.09%)-5ms (- 1.02%)490ms503ms
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)
BenchmarkNameIterations
Current521236
Baselinemain6

Startup

Comparison Report - main..52123
Metricmain52123DeltaBestWorst
tsc-startup - node (v16.17.1, x64)
Execution time139.22ms (± 0.24%)139.04ms (± 0.19%)-0.17ms (- 0.13%)137.99ms142.38ms
tsserver-startup - node (v16.17.1, x64)
Execution time229.56ms (± 0.18%)231.08ms (± 0.17%)+1.52ms (+ 0.66%)229.64ms234.89ms
tsserverlibrary-startup - node (v16.17.1, x64)
Execution time232.52ms (± 0.17%)233.46ms (± 0.19%)+0.93ms (+ 0.40%)231.83ms240.22ms
typescript-startup - node (v16.17.1, x64)
Execution time213.99ms (± 0.21%)214.98ms (± 0.16%)+0.99ms (+ 0.46%)213.59ms220.34ms
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)
BenchmarkNameIterations
Current521236
Baselinemain6

Developer Information:

Download Benchmark

@jakebailey

Copy link
Copy Markdown
Member

Another example that I didn't realize was affected is this:

interfaceA{a: string;}interfaceBextendsA{b: string;}interfaceCextendsA{c: string}

Then:

declarefunctionisC(x: A): x is C;declarefunctionevery<T,UextendsT>(array: readonlyT[],callback: (element: T,index: number)=>element is U): array is readonlyU[];declarefunctionevery<T,UextendsT>(array: readonlyT[]|undefined,callback: (element: T,index: number)=>element is U): array is readonlyU[]|undefined;declarefunctionevery<T>(array: readonlyT[]|undefined,callback: (element: T,index: number)=>boolean): boolean;functionfoo(arr: readonlyB[]|readonlyC[]|undefined){if(every(arr,isC)){arr;}}

In TS 4.9, this code errors because it picks every<B, B>, but now, it picks every<A, C>, and we get arr narrowed to readonly C[]. This comes up quite a bit on the SFT branch.

(I may send a PR for this test case too.)

Jake Bailey (jakebailey) added a commit to jakebailey/TypeScript that referenced this pull request Jan 10, 2023
@jakebailey

Copy link
Copy Markdown
Member

I have another followup case that turned out to not be fixed (I also didn't catch it in the SFT branch in the same way as the above fixed case); I'll file a new issue.

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

None yet

Development

Successfully merging this pull request may close these issues.

Sub-optimal type parameter inference with strictFunctionTypes enabled

4 participants

@ahejlsberg@jakebailey@typescript-bot@RyanCavanaugh