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

Deprioritize inferences made from implicit never arrays #54006

Open
wants to merge 8 commits into
base: main
Choose a base branch
from

Conversation

Andarist
Copy link
Contributor

fixes #54000
it tweaks the logic introduced in #44126 , cc @weswigham

@Andarist Andarist force-pushed the avoid-deprioritization-of-some-mapped-type-inferences branch from 149870c to f050215 Compare April 25, 2023 11:28
@sandersn sandersn added this to Not started in PR Backlog May 8, 2023
@sandersn sandersn requested a review from weswigham May 24, 2023 22:28
@sandersn sandersn moved this from Not started to Waiting on reviewers in PR Backlog May 24, 2023
@sandersn sandersn requested a review from gabritto May 24, 2023 22:29
@weswigham
Copy link
Member

@typescript-bot test this
@typescript-bot run dt
@typescript-bot test top100
@typescript-bot perf test this

@typescript-bot
Copy link
Collaborator

typescript-bot commented Jun 1, 2023

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

@typescript-bot
Copy link
Collaborator

typescript-bot commented Jun 1, 2023

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

Update: The results are in!

@typescript-bot
Copy link
Collaborator

typescript-bot commented Jun 1, 2023

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

Update: The results are in!

@typescript-bot
Copy link
Collaborator

typescript-bot commented Jun 1, 2023

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

Update: The results are in!

@typescript-bot
Copy link
Collaborator

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

Here they are:

Compiler

Comparison Report - main..54006
Metric main 54006 Delta Best Worst p-value
Angular - node (v18.10.0, x64)
Memory used 365,816k (± 0.01%) 365,801k (± 0.01%) ~ 365,767k 365,822k p=0.377 n=6
Parse Time 3.44s (± 1.25%) 3.42s (± 0.22%) ~ 3.41s 3.43s p=0.511 n=6
Bind Time 1.12s (± 0.67%) 1.11s (± 0.73%) ~ 1.10s 1.12s p=0.120 n=6
Check Time 8.75s (± 0.40%) 8.76s (± 0.47%) ~ 8.71s 8.81s p=0.809 n=6
Emit Time 7.43s (± 0.63%) 7.43s (± 0.35%) ~ 7.39s 7.46s p=1.000 n=6
Total Time 20.74s (± 0.32%) 20.71s (± 0.35%) ~ 20.64s 20.83s p=0.470 n=6
Compiler-Unions - node (v18.10.0, x64)
Memory used 191,148k (± 0.02%) 193,048k (± 1.52%) ~ 191,128k 196,887k p=0.298 n=6
Parse Time 1.51s (± 0.88%) 1.49s (± 1.90%) ~ 1.45s 1.52s p=0.164 n=6
Bind Time 0.77s (± 0.67%) 0.78s (± 0.71%) ~ 0.77s 0.78s p=0.640 n=6
Check Time 9.47s (± 0.54%) 9.45s (± 0.83%) ~ 9.35s 9.59s p=0.286 n=6
Emit Time 2.77s (± 1.75%) 2.75s (± 1.35%) ~ 2.71s 2.81s p=0.574 n=6
Total Time 14.52s (± 0.45%) 14.46s (± 0.93%) ~ 14.30s 14.70s p=0.230 n=6
Monaco - node (v18.10.0, x64)
Memory used 346,630k (± 0.01%) 346,624k (± 0.01%) ~ 346,599k 346,653k p=0.575 n=6
Parse Time 2.59s (± 0.85%) 2.59s (± 1.31%) ~ 2.53s 2.61s p=1.000 n=6
Bind Time 1.00s (± 0.51%) 1.01s (± 0.81%) ~ 1.00s 1.02s p=0.523 n=6
Check Time 7.14s (± 0.45%) 7.16s (± 0.57%) ~ 7.12s 7.23s p=0.377 n=6
Emit Time 4.24s (± 0.35%) 4.26s (± 0.57%) ~ 4.24s 4.31s p=0.070 n=6
Total Time 14.97s (± 0.46%) 15.02s (± 0.57%) ~ 14.90s 15.16s p=0.421 n=6
TFS - node (v18.10.0, x64)
Memory used 300,624k (± 0.00%) 300,625k (± 0.00%) ~ 300,603k 300,641k p=0.686 n=6
Parse Time 2.06s (± 0.37%) 2.07s (± 1.72%) ~ 2.02s 2.12s p=0.683 n=6
Bind Time 1.13s (± 0.92%) 1.14s (± 0.90%) ~ 1.13s 1.16s p=0.241 n=6
Check Time 6.63s (± 0.53%) 6.64s (± 0.40%) ~ 6.59s 6.67s p=0.624 n=6
Emit Time 3.87s (± 0.63%) 3.87s (± 0.76%) ~ 3.84s 3.91s p=0.871 n=6
Total Time 13.69s (± 0.36%) 13.72s (± 0.28%) ~ 13.64s 13.75s p=0.227 n=6
material-ui - node (v18.10.0, x64)
Memory used 481,755k (± 0.01%) 481,766k (± 0.01%) ~ 481,664k 481,829k p=0.575 n=6
Parse Time 3.11s (± 0.44%) 3.12s (± 0.53%) ~ 3.09s 3.13s p=0.934 n=6
Bind Time 0.92s (± 0.44%) 0.91s (± 1.08%) ~ 0.90s 0.92s p=0.071 n=6
Check Time 16.78s (± 0.50%) 16.84s (± 0.58%) ~ 16.76s 17.02s p=0.630 n=6
Emit Time 0.00s (± 0.00%) 0.00s (± 0.00%) ~ 0.00s 0.00s p=1.000 n=6
Total Time 20.82s (± 0.43%) 20.86s (± 0.49%) ~ 20.78s 21.05s p=0.810 n=6
xstate - node (v18.10.0, x64)
Memory used 562,983k (± 0.02%) 563,062k (± 0.02%) ~ 562,923k 563,166k p=0.230 n=6
Parse Time 3.81s (± 0.75%) 3.82s (± 0.38%) ~ 3.81s 3.84s p=0.197 n=6
Bind Time 1.63s (± 0.74%) 1.64s (± 0.46%) +0.01s (+ 0.92%) 1.63s 1.65s p=0.042 n=6
Check Time 2.81s (± 0.99%) 2.82s (± 1.07%) ~ 2.79s 2.86s p=0.936 n=6
Emit Time 0.08s (± 0.00%) 0.08s (± 0.00%) ~ 0.08s 0.08s p=1.000 n=6
Total Time 8.34s (± 0.45%) 8.37s (± 0.52%) ~ 8.31s 8.42s p=0.198 n=6
Angular - node (v16.17.1, x64)
Memory used 365,246k (± 0.01%) 365,199k (± 0.01%) ~ 365,135k 365,258k p=0.228 n=6
Parse Time 3.56s (± 0.68%) 3.56s (± 0.49%) ~ 3.54s 3.59s p=0.808 n=6
Bind Time 1.19s (± 0.63%) 1.19s (± 0.71%) ~ 1.18s 1.20s p=0.432 n=6
Check Time 9.57s (± 0.41%) 9.54s (± 0.43%) ~ 9.48s 9.60s p=0.259 n=6
Emit Time 7.94s (± 0.99%) 7.92s (± 1.28%) ~ 7.86s 8.12s p=0.374 n=6
Total Time 22.25s (± 0.49%) 22.21s (± 0.59%) ~ 22.11s 22.45s p=0.423 n=6
Compiler-Unions - node (v16.17.1, x64)
Memory used 193,498k (± 0.73%) 192,904k (± 0.03%) ~ 192,840k 192,983k p=0.378 n=6
Parse Time 1.61s (± 1.02%) 1.61s (± 0.85%) ~ 1.58s 1.62s p=0.858 n=6
Bind Time 0.83s (± 0.49%) 0.83s (± 0.49%) ~ 0.82s 0.83s p=1.000 n=6
Check Time 10.20s (± 0.53%) 10.20s (± 0.31%) ~ 10.17s 10.26s p=0.872 n=6
Emit Time 3.01s (± 0.59%) 3.03s (± 0.76%) ~ 2.99s 3.05s p=0.104 n=6
Total Time 15.63s (± 0.43%) 15.67s (± 0.28%) ~ 15.62s 15.74s p=0.335 n=6
Monaco - node (v16.17.1, x64)
Memory used 345,888k (± 0.01%) 345,889k (± 0.00%) ~ 345,880k 345,908k p=0.936 n=6
Parse Time 2.73s (± 0.55%) 2.74s (± 0.38%) ~ 2.72s 2.75s p=0.679 n=6
Bind Time 1.09s (± 0.69%) 1.08s (± 0.75%) ~ 1.07s 1.09s p=0.383 n=6
Check Time 7.84s (± 0.50%) 7.85s (± 0.36%) ~ 7.82s 7.90s p=0.572 n=6
Emit Time 4.47s (± 0.95%) 4.46s (± 0.66%) ~ 4.41s 4.49s p=0.686 n=6
Total Time 16.13s (± 0.58%) 16.13s (± 0.12%) ~ 16.11s 16.16s p=1.000 n=6
TFS - node (v16.17.1, x64)
Memory used 299,974k (± 0.01%) 299,956k (± 0.01%) ~ 299,932k 299,981k p=0.298 n=6
Parse Time 2.16s (± 0.61%) 2.17s (± 0.91%) ~ 2.15s 2.20s p=1.000 n=6
Bind Time 1.24s (± 0.61%) 1.23s (± 0.95%) ~ 1.22s 1.25s p=0.279 n=6
Check Time 7.26s (± 0.29%) 7.25s (± 0.42%) ~ 7.22s 7.31s p=0.686 n=6
Emit Time 4.34s (± 0.92%) 4.35s (± 1.02%) ~ 4.30s 4.43s p=1.000 n=6
Total Time 15.00s (± 0.28%) 15.00s (± 0.57%) ~ 14.89s 15.15s p=0.420 n=6
material-ui - node (v16.17.1, x64)
Memory used 480,993k (± 0.00%) 480,996k (± 0.01%) ~ 480,959k 481,040k p=0.936 n=6
Parse Time 3.27s (± 0.45%) 3.25s (± 0.57%) ~ 3.22s 3.27s p=0.160 n=6
Bind Time 0.94s (± 1.34%) 0.94s (± 0.95%) ~ 0.93s 0.95s p=0.933 n=6
Check Time 17.79s (± 0.60%) 17.84s (± 0.47%) ~ 17.69s 17.93s p=0.377 n=6
Emit Time 0.00s (± 0.00%) 0.00s (± 0.00%) ~ 0.00s 0.00s p=1.000 n=6
Total Time 22.00s (± 0.49%) 22.04s (± 0.42%) ~ 21.88s 22.16s p=0.687 n=6
xstate - node (v16.17.1, x64)
Memory used 560,599k (± 0.01%) 560,603k (± 0.01%) ~ 560,568k 560,704k p=0.689 n=6
Parse Time 4.00s (± 0.75%) 4.00s (± 0.34%) ~ 3.99s 4.02s p=0.331 n=6
Bind Time 1.76s (± 0.69%) 1.77s (± 0.75%) ~ 1.75s 1.79s p=0.863 n=6
Check Time 3.05s (± 0.46%) 3.07s (± 0.70%) ~ 3.04s 3.10s p=0.195 n=6
Emit Time 0.09s (± 0.00%) 0.09s (± 0.00%) ~ 0.09s 0.09s p=1.000 n=6
Total Time 8.91s (± 0.50%) 8.94s (± 0.34%) ~ 8.91s 8.99s p=0.227 n=6
Angular - node (v14.21.3, x64)
Memory used 359,210k (± 0.01%) 359,214k (± 0.01%) ~ 359,180k 359,247k p=0.575 n=6
Parse Time 3.67s (± 0.40%) 3.69s (± 0.76%) ~ 3.66s 3.73s p=0.325 n=6
Bind Time 1.22s (± 0.52%) 1.22s (± 0.33%) ~ 1.21s 1.22s p=0.673 n=6
Check Time 10.02s (± 0.24%) 10.05s (± 0.32%) +0.04s (+ 0.40%) 10.00s 10.09s p=0.037 n=6
Emit Time 8.36s (± 0.60%) 8.33s (± 0.55%) ~ 8.26s 8.40s p=0.628 n=6
Total Time 23.26s (± 0.17%) 23.29s (± 0.18%) ~ 23.23s 23.33s p=0.195 n=6
Compiler-Unions - node (v14.21.3, x64)
Memory used 188,282k (± 0.02%) 188,278k (± 0.01%) ~ 188,248k 188,302k p=0.575 n=6
Parse Time 1.61s (± 0.61%) 1.62s (± 0.72%) ~ 1.60s 1.63s p=0.314 n=6
Bind Time 0.84s (± 0.61%) 0.85s (± 1.29%) ~ 0.84s 0.87s p=0.247 n=6
Check Time 10.29s (± 0.64%) 10.34s (± 0.58%) ~ 10.26s 10.41s p=0.261 n=6
Emit Time 3.12s (± 0.92%) 3.16s (± 0.75%) +0.04s (+ 1.39%) 3.13s 3.19s p=0.024 n=6
Total Time 15.87s (± 0.48%) 15.97s (± 0.51%) ~ 15.84s 16.04s p=0.078 n=6
Monaco - node (v14.21.3, x64)
Memory used 341,027k (± 0.01%) 341,036k (± 0.00%) ~ 341,033k 341,043k p=1.000 n=6
Parse Time 2.80s (± 0.55%) 2.81s (± 0.63%) ~ 2.78s 2.83s p=0.685 n=6
Bind Time 1.12s (± 0.73%) 1.11s (± 1.55%) ~ 1.08s 1.13s p=0.402 n=6
Check Time 8.19s (± 0.46%) 8.19s (± 0.49%) ~ 8.12s 8.24s p=1.000 n=6
Emit Time 4.71s (± 0.58%) 4.68s (± 0.32%) ~ 4.67s 4.71s p=0.088 n=6
Total Time 16.81s (± 0.32%) 16.79s (± 0.29%) ~ 16.73s 16.87s p=0.336 n=6
TFS - node (v14.21.3, x64)
Memory used 295,140k (± 0.00%) 295,138k (± 0.00%) ~ 295,133k 295,143k p=0.807 n=6
Parse Time 2.39s (± 0.41%) 2.42s (± 0.51%) +0.03s (+ 1.12%) 2.39s 2.42s p=0.012 n=6
Bind Time 1.06s (± 1.41%) 1.07s (± 0.00%) ~ 1.07s 1.07s p=0.342 n=6
Check Time 7.60s (± 0.51%) 7.61s (± 0.44%) ~ 7.56s 7.65s p=0.466 n=6
Emit Time 4.33s (± 1.35%) 4.33s (± 0.71%) ~ 4.30s 4.38s p=0.810 n=6
Total Time 15.39s (± 0.61%) 15.43s (± 0.45%) ~ 15.32s 15.50s p=0.423 n=6
material-ui - node (v14.21.3, x64)
Memory used 476,575k (± 0.01%) 476,571k (± 0.01%) ~ 476,512k 476,594k p=0.810 n=6
Parse Time 3.33s (± 0.44%) 3.33s (± 0.48%) ~ 3.32s 3.36s p=0.803 n=6
Bind Time 1.01s (± 1.08%) 1.00s (± 0.54%) ~ 1.00s 1.01s p=0.476 n=6
Check Time 18.75s (± 0.74%) 18.73s (± 0.51%) ~ 18.56s 18.82s p=0.809 n=6
Emit Time 0.00s (± 0.00%) 0.00s (± 0.00%) ~ 0.00s 0.00s p=1.000 n=6
Total Time 23.08s (± 0.55%) 23.07s (± 0.47%) ~ 22.88s 23.17s p=1.000 n=6
xstate - node (v14.21.3, x64)
Memory used 549,640k (± 0.00%) 549,643k (± 0.00%) ~ 549,625k 549,689k p=0.936 n=6
Parse Time 4.23s (± 0.80%) 4.23s (± 0.26%) ~ 4.22s 4.25s p=0.573 n=6
Bind Time 1.64s (± 3.55%) 1.65s (± 3.14%) ~ 1.57s 1.69s p=0.936 n=6
Check Time 3.17s (± 1.03%) 3.17s (± 0.69%) ~ 3.14s 3.20s p=0.872 n=6
Emit Time 0.09s (± 5.53%) 0.09s (± 0.00%) ~ 0.09s 0.09s p=0.174 n=6
Total Time 9.13s (± 0.89%) 9.14s (± 0.68%) ~ 9.03s 9.20s p=0.873 n=6
System
Machine Namets-ci-ubuntu
Platformlinux 5.4.0-148-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.21.3, x64)
Scenarios
  • Angular - node (v18.10.0, x64)
  • Angular - node (v16.17.1, x64)
  • Angular - node (v14.21.3, x64)
  • Compiler-Unions - node (v18.10.0, x64)
  • Compiler-Unions - node (v16.17.1, x64)
  • Compiler-Unions - node (v14.21.3, x64)
  • Monaco - node (v18.10.0, x64)
  • Monaco - node (v16.17.1, x64)
  • Monaco - node (v14.21.3, x64)
  • TFS - node (v18.10.0, x64)
  • TFS - node (v16.17.1, x64)
  • TFS - node (v14.21.3, x64)
  • material-ui - node (v18.10.0, x64)
  • material-ui - node (v16.17.1, x64)
  • material-ui - node (v14.21.3, x64)
  • xstate - node (v18.10.0, x64)
  • xstate - node (v16.17.1, x64)
  • xstate - node (v14.21.3, x64)
Benchmark Name Iterations
Current 54006 6
Baseline main 6

TSServer

Comparison Report - main..54006
Metric main 54006 Delta Best Worst p-value
Compiler-UnionsTSServer - node (v18.10.0, x64)
Req 1 - updateOpen 2,546ms (± 0.27%) 2,533ms (± 0.40%) -13ms (- 0.52%) 2,519ms 2,549ms p=0.045 n=6
Req 2 - geterr 5,614ms (± 0.32%) 5,563ms (± 0.66%) -52ms (- 0.92%) 5,524ms 5,609ms p=0.013 n=6
Req 3 - references 337ms (± 0.64%) 337ms (± 0.91%) ~ 333ms 340ms p=0.935 n=6
Req 4 - navto 289ms (± 1.16%) 286ms (± 0.58%) ~ 284ms 288ms p=0.120 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 85ms (± 0.74%) 85ms (± 0.96%) ~ 84ms 86ms p=0.432 n=6
CompilerTSServer - node (v18.10.0, x64)
Req 1 - updateOpen 2,631ms (± 0.60%) 2,648ms (± 1.18%) ~ 2,606ms 2,695ms p=0.575 n=6
Req 2 - geterr 4,287ms (± 0.30%) 4,286ms (± 0.59%) ~ 4,248ms 4,318ms p=0.936 n=6
Req 3 - references 349ms (± 0.70%) 349ms (± 0.33%) ~ 348ms 351ms p=0.418 n=6
Req 4 - navto 292ms (± 0.50%) 292ms (± 0.68%) ~ 290ms 295ms p=0.622 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 63ms (± 0.65%) 64ms (± 3.95%) ~ 62ms 69ms p=0.390 n=6
xstateTSServer - node (v18.10.0, x64)
Req 1 - updateOpen 3,071ms (± 0.35%) 3,084ms (± 0.68%) ~ 3,058ms 3,115ms p=0.297 n=6
Req 2 - geterr 1,572ms (± 1.31%) 1,564ms (± 1.27%) ~ 1,546ms 1,600ms p=0.377 n=6
Req 3 - references 114ms (± 1.33%) 113ms (± 0.36%) ~ 113ms 114ms p=0.863 n=6
Req 4 - navto 360ms (± 0.59%) 360ms (± 0.35%) ~ 359ms 362ms p=0.683 n=6
Req 5 - completionInfo count 2,862 (± 0.00%) 2,862 (± 0.00%) ~ 2,862 2,862 p=1.000 n=6
Req 5 - completionInfo 384ms (± 1.68%) 379ms (± 1.83%) ~ 365ms 385ms p=0.421 n=6
Compiler-UnionsTSServer - node (v16.17.1, x64)
Req 1 - updateOpen 2,644ms (± 0.39%) 2,661ms (± 0.61%) +17ms (+ 0.66%) 2,647ms 2,692ms p=0.045 n=6
Req 2 - geterr 6,039ms (± 0.82%) 6,039ms (± 0.60%) ~ 5,990ms 6,084ms p=1.000 n=6
Req 3 - references 352ms (± 0.64%) 353ms (± 0.39%) ~ 351ms 355ms p=0.805 n=6
Req 4 - navto 289ms (± 1.13%) 290ms (± 1.94%) ~ 283ms 298ms p=0.685 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 93ms (± 0.96%) 93ms (± 1.06%) ~ 92ms 94ms p=0.798 n=6
CompilerTSServer - node (v16.17.1, x64)
Req 1 - updateOpen 2,825ms (± 0.24%) 2,834ms (± 0.28%) ~ 2,827ms 2,847ms p=0.195 n=6
Req 2 - geterr 4,647ms (± 0.22%) 4,662ms (± 0.25%) +15ms (+ 0.33%) 4,643ms 4,671ms p=0.045 n=6
Req 3 - references 366ms (± 0.37%) 365ms (± 0.59%) ~ 362ms 368ms p=0.168 n=6
Req 4 - navto 285ms (± 0.73%) 286ms (± 0.96%) ~ 281ms 288ms p=0.194 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.60%) 68ms (± 1.21%) ~ 67ms 69ms p=0.584 n=6
xstateTSServer - node (v16.17.1, x64)
Req 1 - updateOpen 3,214ms (± 0.82%) 3,209ms (± 0.44%) ~ 3,192ms 3,227ms p=0.936 n=6
Req 2 - geterr 1,742ms (± 0.49%) 1,734ms (± 0.48%) ~ 1,723ms 1,745ms p=0.148 n=6
Req 3 - references 131ms (± 8.30%) 126ms (± 6.69%) 🟩-5ms (- 3.94%) 122ms 143ms p=0.042 n=6
Req 4 - navto 342ms (± 0.34%) 342ms (± 0.50%) ~ 340ms 345ms p=0.561 n=6
Req 5 - completionInfo count 2,862 (± 0.00%) 2,862 (± 0.00%) ~ 2,862 2,862 p=1.000 n=6
Req 5 - completionInfo 412ms (± 1.20%) 415ms (± 1.52%) ~ 405ms 421ms p=0.336 n=6
Compiler-UnionsTSServer - node (v14.21.3, x64)
Req 1 - updateOpen 2,791ms (± 0.40%) 2,807ms (± 0.64%) ~ 2,782ms 2,828ms p=0.128 n=6
Req 2 - geterr 6,190ms (± 0.54%) 6,210ms (± 0.37%) ~ 6,166ms 6,228ms p=0.423 n=6
Req 3 - references 363ms (± 1.30%) 361ms (± 0.48%) ~ 358ms 363ms p=0.738 n=6
Req 4 - navto 290ms (± 1.67%) 289ms (± 0.51%) ~ 287ms 291ms p=0.416 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 (± 4.77%) 98ms (± 5.28%) ~ 92ms 104ms p=0.413 n=6
CompilerTSServer - node (v14.21.3, x64)
Req 1 - updateOpen 2,967ms (± 0.44%) 2,984ms (± 0.60%) ~ 2,961ms 3,004ms p=0.149 n=6
Req 2 - geterr 4,541ms (± 0.74%) 4,572ms (± 1.83%) ~ 4,486ms 4,731ms p=0.688 n=6
Req 3 - references 376ms (± 0.40%) 377ms (± 1.03%) ~ 374ms 384ms p=1.000 n=6
Req 4 - navto 298ms (± 0.45%) 299ms (± 0.41%) ~ 297ms 300ms p=0.273 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 78ms (± 3.53%) 76ms (± 1.30%) ~ 74ms 77ms p=0.152 n=6
xstateTSServer - node (v14.21.3, x64)
Req 1 - updateOpen 3,487ms (± 1.87%) 3,535ms (± 0.67%) ~ 3,506ms 3,574ms p=0.258 n=6
Req 2 - geterr 1,839ms (± 0.54%) 1,849ms (± 0.67%) ~ 1,830ms 1,864ms p=0.173 n=6
Req 3 - references 151ms (± 8.13%) 150ms (± 9.38%) ~ 137ms 170ms p=0.871 n=6
Req 4 - navto 392ms (± 0.90%) 398ms (± 1.72%) ~ 390ms 407ms p=0.146 n=6
Req 5 - completionInfo count 2,862 (± 0.00%) 2,862 (± 0.00%) ~ 2,862 2,862 p=1.000 n=6
Req 5 - completionInfo 435ms (± 0.59%) 433ms (± 1.85%) ~ 420ms 441ms p=0.872 n=6
System
Machine Namets-ci-ubuntu
Platformlinux 5.4.0-148-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.21.3, x64)
Scenarios
  • Compiler-UnionsTSServer - node (v18.10.0, x64)
  • Compiler-UnionsTSServer - node (v16.17.1, x64)
  • Compiler-UnionsTSServer - node (v14.21.3, x64)
  • CompilerTSServer - node (v18.10.0, x64)
  • CompilerTSServer - node (v16.17.1, x64)
  • CompilerTSServer - node (v14.21.3, x64)
  • xstateTSServer - node (v18.10.0, x64)
  • xstateTSServer - node (v16.17.1, x64)
  • xstateTSServer - node (v14.21.3, x64)
Benchmark Name Iterations
Current 54006 6
Baseline main 6

Startup

Comparison Report - main..54006
Metric main 54006 Delta Best Worst p-value
tsc-startup - node (v16.17.1, x64)
Execution time 142.29ms (± 0.22%) 141.66ms (± 0.22%) -0.63ms (- 0.45%) 141.03ms 147.16ms p=0.000 n=600
tsserver-startup - node (v16.17.1, x64)
Execution time 221.07ms (± 0.18%) 220.93ms (± 0.19%) -0.14ms (- 0.06%) 219.94ms 230.68ms p=0.000 n=600
tsserverlibrary-startup - node (v16.17.1, x64)
Execution time 222.08ms (± 0.15%) 222.10ms (± 0.16%) ~ 221.28ms 228.58ms p=0.215 n=600
typescript-startup - node (v16.17.1, x64)
Execution time 203.93ms (± 0.15%) 203.93ms (± 0.13%) ~ 203.03ms 206.84ms p=0.084 n=600
System
Machine Namets-ci-ubuntu
Platformlinux 5.4.0-148-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 54006 6
Baseline main 6

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/54006/merge:

Everything looks good!

@typescript-bot
Copy link
Collaborator

Hey @weswigham, the results of running the DT tests are ready.
Everything looks the same!
You can check the log here.

@weswigham
Copy link
Member

weswigham commented Nov 7, 2023

@Andarist A much better fix, IMO, would be to deprioritize inferences from the never that comes from an empty array expression (the implicitNeverType) even lower than mapped type ones (since it's moreso an absence of type information than useful information!)

So.... toss in a new InferencePriority for implicitNeverType inferences, make sure it's a bigger number than the mapped type one, and make sure it's set in inferTypes when the source is a implicitNeverType. Should solve all the reports I've seen, if I have a good handle on how inference behaves.

@Andarist Andarist force-pushed the avoid-deprioritization-of-some-mapped-type-inferences branch from 0bc03aa to 7cb45d5 Compare November 12, 2023 22:43
@typescript-bot
Copy link
Collaborator

Looks like you're introducing a change to the public API surface area. If this includes breaking changes, please document them on our wiki's API Breaking Changes page.

Also, please make sure @DanielRosenwasser and @RyanCavanaugh are aware of the changes, just as a heads up.

@Andarist Andarist marked this pull request as draft November 12, 2023 22:52
@Andarist Andarist marked this pull request as ready for review November 12, 2023 23:30
@Andarist
Copy link
Contributor Author

@weswigham I've pushed out the requested changes. The problem wasn't quite about implicitNeverType itself but rather about implicitNeverType[] - so I'm checking against that. I tried to figure out a way to make implicitNeverType an inference source but I couldn't so I dropped a check targeting it that I had there briefly (can be seen in the commit history).

@Andarist Andarist changed the title Avoid deprioritization of inferences made from mapped types with primitive type parameter constraints Deprioritize inferences made from implicit never arrays Nov 12, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
For Uncommitted Bug PR for untriaged, rejected, closed or missing bug
Projects
PR Backlog
  
Waiting on reviewers
Development

Successfully merging this pull request may close these issues.

Using type alias for record prevents compiler from inferring generic function argument correctly
3 participants