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

Narrow generic conditional and indexed access return types when checking return statements, no conditional expression support #60268

Closed
wants to merge 93 commits into from

Conversation

gabritto
Copy link
Member

@gabritto gabritto commented Oct 18, 2024

A version of #56941 without any of the extra stuff for checking conditional expressions.

@typescript-bot typescript-bot added Author: Team For Uncommitted Bug PR for untriaged, rejected, closed or missing bug labels Oct 18, 2024
@gabritto
Copy link
Member Author

@typescript-bot perf test this

@typescript-bot
Copy link
Collaborator

typescript-bot commented Oct 18, 2024

Starting jobs; this comment will be updated as builds start and complete.

Command Status Results
perf test this ✅ Started 👀 Results

@typescript-bot
Copy link
Collaborator

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

Here they are:

tsc

Comparison Report - baseline..pr
Metric baseline pr Delta Best Worst p-value
Compiler-Unions - node (v18.15.0, x64)
Errors 31 31 ~ ~ ~ p=1.000 n=6
Symbols 62,340 62,337 -3 (- 0.00%) ~ ~ p=0.001 n=6
Types 50,379 50,378 -1 (- 0.00%) ~ ~ p=0.001 n=6
Memory used 195,069k (± 0.92%) 194,890k (± 1.00%) ~ 192,989k 196,699k p=0.378 n=6
Parse Time 1.32s (± 0.64%) 1.30s (± 0.63%) -0.01s (- 0.89%) 1.29s 1.31s p=0.045 n=6
Bind Time 0.72s 0.72s (± 0.57%) ~ 0.71s 0.72s p=0.405 n=6
Check Time 9.72s (± 0.73%) 9.78s (± 0.26%) ~ 9.75s 9.82s p=0.107 n=6
Emit Time 2.75s (± 1.00%) 2.73s (± 0.38%) ~ 2.72s 2.75s p=0.220 n=6
Total Time 14.50s (± 0.43%) 14.54s (± 0.16%) ~ 14.51s 14.58s p=0.419 n=6
angular-1 - node (v18.15.0, x64)
Errors 33 33 ~ ~ ~ p=1.000 n=6
Symbols 947,886 947,576 -310 (- 0.03%) ~ ~ p=0.001 n=6
Types 410,840 410,700 -140 (- 0.03%) ~ ~ p=0.001 n=6
Memory used 1,224,815k (± 0.00%) 1,225,876k (± 0.00%) +1,061k (+ 0.09%) 1,225,813k 1,225,971k p=0.005 n=6
Parse Time 8.04s (± 0.73%) 8.12s (± 0.89%) ~ 8.02s 8.23s p=0.065 n=6
Bind Time 2.28s (± 0.66%) 2.27s (± 1.23%) ~ 2.24s 2.31s p=0.745 n=6
Check Time 37.92s (± 0.31%) 37.94s (± 0.29%) ~ 37.78s 38.10s p=0.809 n=6
Emit Time 18.33s (± 0.54%) 18.31s (± 0.49%) ~ 18.19s 18.44s p=1.000 n=6
Total Time 66.56s (± 0.29%) 66.64s (± 0.32%) ~ 66.26s 66.86s p=0.520 n=6
mui-docs - node (v18.15.0, x64)
Errors 0 0 ~ ~ ~ p=1.000 n=6
Symbols 2,530,445 2,484,344 -46,101 (- 1.82%) ~ ~ p=0.001 n=6
Types 916,594 914,759 -1,835 (- 0.20%) ~ ~ p=0.001 n=6
Memory used 2,342,014k (± 0.00%) 2,332,708k (± 0.01%) -9,306k (- 0.40%) 2,332,469k 2,332,962k p=0.005 n=6
Parse Time 11.23s (± 0.52%) 11.19s (± 0.54%) ~ 11.08s 11.24s p=0.229 n=6
Bind Time 2.63s (± 0.57%) 2.62s (± 0.52%) ~ 2.61s 2.64s p=0.680 n=6
Check Time 90.94s (± 0.21%) 90.50s (± 0.30%) -0.44s (- 0.48%) 89.98s 90.75s p=0.020 n=6
Emit Time 0.36s (± 2.35%) 0.35s (± 2.14%) ~ 0.34s 0.36s p=0.652 n=6
Total Time 105.16s (± 0.21%) 104.66s (± 0.27%) -0.50s (- 0.48%) 104.12s 104.92s p=0.016 n=6
self-build-src - node (v18.15.0, x64)
Errors 0 0 ~ ~ ~ p=1.000 n=6
Symbols 1,258,032 1,258,184 +152 (+ 0.01%) ~ ~ p=0.001 n=6
Types 266,259 266,226 -33 (- 0.01%) ~ ~ p=0.001 n=6
Memory used 3,146,643k (± 0.02%) 3,150,265k (± 0.03%) +3,622k (+ 0.12%) 3,149,068k 3,151,551k p=0.005 n=6
Parse Time 6.62s (± 0.46%) 6.56s (± 0.45%) -0.06s (- 0.88%) 6.52s 6.61s p=0.016 n=6
Bind Time 2.29s (± 4.46%) 2.35s (± 1.00%) ~ 2.32s 2.38s p=0.108 n=6
Check Time 43.11s (± 0.46%) 43.05s (± 0.20%) ~ 42.94s 43.19s p=0.748 n=6
Emit Time 3.47s (± 2.48%) 3.54s (± 3.51%) ~ 3.31s 3.64s p=0.199 n=6
Total Time 55.48s (± 0.58%) 55.52s (± 0.26%) ~ 55.30s 55.68s p=1.000 n=6
self-build-src-public-api - node (v18.15.0, x64)
Errors 0 0 ~ ~ ~ p=1.000 n=6
Symbols 1,258,032 1,258,184 +152 (+ 0.01%) ~ ~ p=0.001 n=6
Types 266,259 266,226 -33 (- 0.01%) ~ ~ p=0.001 n=6
Memory used 2,765,526k (±12.86%) 2,742,220k (±13.57%) ~ 2,501,137k 3,223,249k p=0.378 n=6
Parse Time 8.33s (± 2.22%) 8.26s (± 2.63%) ~ 8.06s 8.59s p=0.378 n=6
Bind Time 2.72s (± 4.99%) 2.69s (± 3.77%) ~ 2.57s 2.88s p=1.000 n=6
Check Time 53.61s (± 0.85%) 53.53s (± 0.26%) ~ 53.39s 53.68s p=0.810 n=6
Emit Time 4.40s (± 3.18%) 4.34s (± 1.20%) ~ 4.27s 4.39s p=0.378 n=6
Total Time 69.05s (± 0.66%) 68.82s (± 0.24%) ~ 68.65s 69.10s p=0.423 n=6
self-compiler - node (v18.15.0, x64)
Errors 0 0 ~ ~ ~ p=1.000 n=6
Symbols 261,789 262,141 +352 (+ 0.13%) ~ ~ p=0.001 n=6
Types 106,511 106,574 +63 (+ 0.06%) ~ ~ p=0.001 n=6
Memory used 438,806k (± 0.01%) 439,712k (± 0.02%) +906k (+ 0.21%) 439,551k 439,792k p=0.005 n=6
Parse Time 4.38s (± 1.05%) 4.38s (± 0.37%) ~ 4.35s 4.40s p=0.627 n=6
Bind Time 1.61s (± 1.87%) 1.62s (± 0.55%) ~ 1.61s 1.63s p=0.563 n=6
Check Time 23.41s (± 0.21%) 23.40s (± 0.41%) ~ 23.30s 23.55s p=0.688 n=6
Emit Time 1.91s (± 0.97%) 1.92s (± 1.45%) ~ 1.89s 1.97s p=0.935 n=6
Total Time 31.31s (± 0.31%) 31.32s (± 0.30%) ~ 31.24s 31.47s p=0.936 n=6
ts-pre-modules - node (v18.15.0, x64)
Errors 68 68 ~ ~ ~ p=1.000 n=6
Symbols 225,919 225,912 -7 (- 0.00%) ~ ~ p=0.001 n=6
Types 94,415 94,413 -2 (- 0.00%) ~ ~ p=0.001 n=6
Memory used 371,082k (± 0.01%) 371,473k (± 0.01%) +391k (+ 0.11%) 371,420k 371,532k p=0.005 n=6
Parse Time 2.90s (± 0.38%) 2.90s (± 1.37%) ~ 2.87s 2.96s p=0.742 n=6
Bind Time 1.59s (± 1.34%) 1.57s (± 0.94%) ~ 1.55s 1.59s p=0.120 n=6
Check Time 16.40s (± 0.47%) 16.38s (± 0.15%) ~ 16.35s 16.41s p=0.374 n=6
Emit Time 0.00s 0.00s ~ ~ ~ p=1.000 n=6
Total Time 20.89s (± 0.38%) 20.85s (± 0.27%) ~ 20.79s 20.93s p=0.377 n=6
vscode - node (v18.15.0, x64)
Errors 3 3 ~ ~ ~ p=1.000 n=6
Symbols 3,118,970 3,116,203 -2,767 (- 0.09%) ~ ~ p=0.001 n=6
Types 1,075,058 1,073,952 -1,106 (- 0.10%) ~ ~ p=0.001 n=6
Memory used 3,212,484k (± 0.01%) 3,216,787k (± 0.01%) +4,304k (+ 0.13%) 3,215,965k 3,217,084k p=0.005 n=6
Parse Time 11.56s (± 0.28%) 11.56s (± 0.12%) ~ 11.55s 11.58s p=0.459 n=6
Bind Time 3.70s (± 0.46%) 3.69s (± 0.22%) ~ 3.68s 3.70s p=0.402 n=6
Check Time 72.20s (± 0.45%) 72.31s (± 0.38%) ~ 71.97s 72.72s p=0.471 n=6
Emit Time 22.67s (± 0.70%) 22.89s (± 1.91%) ~ 22.64s 23.78s p=0.378 n=6
Total Time 110.12s (± 0.44%) 110.46s (± 0.48%) ~ 109.97s 111.43s p=0.378 n=6
webpack - node (v18.15.0, x64)
Errors 0 0 ~ ~ ~ p=1.000 n=6
Symbols 286,241 286,097 -144 (- 0.05%) ~ ~ p=0.001 n=6
Types 116,005 115,937 -68 (- 0.06%) ~ ~ p=0.001 n=6
Memory used 436,644k (± 0.02%) 436,812k (± 0.02%) +168k (+ 0.04%) 436,698k 436,900k p=0.013 n=6
Parse Time 4.09s (± 0.95%) 4.08s (± 1.06%) ~ 4.01s 4.14s p=0.629 n=6
Bind Time 1.74s (± 1.42%) 1.75s (± 0.93%) ~ 1.73s 1.77s p=0.745 n=6
Check Time 18.44s (± 0.45%) 18.48s (± 0.43%) ~ 18.41s 18.59s p=0.468 n=6
Emit Time 0.00s 0.00s ~ ~ ~ p=1.000 n=6
Total Time 24.27s (± 0.34%) 24.30s (± 0.30%) ~ 24.24s 24.43s p=0.688 n=6
xstate-main - node (v18.15.0, x64)
Errors 3 3 ~ ~ ~ p=1.000 n=6
Symbols 543,130 542,780 -350 (- 0.06%) ~ ~ p=0.001 n=6
Types 181,889 181,659 -230 (- 0.13%) ~ ~ p=0.001 n=6
Memory used 485,460k (± 0.02%) 486,156k (± 0.02%) +696k (+ 0.14%) 486,053k 486,324k p=0.005 n=6
Parse Time 3.35s (± 0.81%) 3.35s (± 0.53%) ~ 3.32s 3.37s p=0.513 n=6
Bind Time 1.18s (± 0.69%) 1.17s (± 1.05%) ~ 1.15s 1.18s p=0.120 n=6
Check Time 19.31s (± 2.13%) 19.13s (± 0.52%) ~ 18.99s 19.25s p=0.630 n=6
Emit Time 0.00s 0.00s (±244.70%) ~ 0.00s 0.01s p=0.405 n=6
Total Time 23.84s (± 1.75%) 23.64s (± 0.47%) ~ 23.50s 23.78s p=0.470 n=6
System info unknown
Hosts
  • node (v18.15.0, x64)
Scenarios
  • Compiler-Unions - node (v18.15.0, x64)
  • angular-1 - node (v18.15.0, x64)
  • mui-docs - node (v18.15.0, x64)
  • self-build-src - node (v18.15.0, x64)
  • self-build-src-public-api - node (v18.15.0, x64)
  • self-compiler - node (v18.15.0, x64)
  • ts-pre-modules - node (v18.15.0, x64)
  • vscode - node (v18.15.0, x64)
  • webpack - node (v18.15.0, x64)
  • xstate-main - node (v18.15.0, x64)
Benchmark Name Iterations
Current pr 6
Baseline baseline 6

tsserver

Comparison Report - baseline..pr
Metric baseline pr Delta Best Worst p-value
Compiler-UnionsTSServer - node (v18.15.0, x64)
Req 1 - updateOpen 2,315ms (± 0.30%) 2,321ms (± 0.31%) ~ 2,313ms 2,331ms p=0.378 n=6
Req 2 - geterr 5,297ms (± 0.43%) 5,291ms (± 0.68%) ~ 5,240ms 5,341ms p=0.748 n=6
Req 3 - references 266ms (± 0.28%) 263ms (± 0.68%) -3ms (- 1.19%) 261ms 266ms p=0.014 n=6
Req 4 - navto 227ms (± 0.37%) 227ms (± 0.72%) ~ 224ms 228ms p=0.116 n=6
Req 5 - completionInfo count 1,357 1,357 ~ ~ ~ p=1.000 n=6
Req 5 - completionInfo 81ms (± 5.15%) 82ms (± 6.14%) ~ 76ms 91ms p=0.685 n=6
CompilerTSServer - node (v18.15.0, x64)
Req 1 - updateOpen 2,442ms (± 1.10%) 2,446ms (± 0.97%) ~ 2,410ms 2,466ms p=0.748 n=6
Req 2 - geterr 3,973ms (± 0.50%) 3,968ms (± 0.16%) ~ 3,960ms 3,977ms p=0.810 n=6
Req 3 - references 282ms (± 1.08%) 278ms (± 1.07%) -4ms (- 1.48%) 275ms 283ms p=0.043 n=6
Req 4 - navto 226ms (± 0.28%) 235ms (± 2.78%) +9ms (+ 3.91%) 226ms 240ms p=0.019 n=6
Req 5 - completionInfo count 1,519 1,519 ~ ~ ~ p=1.000 n=6
Req 5 - completionInfo 82ms (± 6.32%) 83ms (± 2.57%) ~ 81ms 86ms p=1.000 n=6
xstate-main-1-tsserver - node (v18.15.0, x64)
Req 1 - updateOpen 5,265ms (± 0.27%) 5,270ms (± 0.27%) ~ 5,254ms 5,295ms p=0.335 n=6
Req 2 - geterr 1,139ms (± 0.79%) 1,143ms (± 0.83%) ~ 1,130ms 1,159ms p=0.374 n=6
Req 3 - references 81ms (± 3.52%) 80ms ~ ~ ~ p=0.405 n=6
Req 4 - navto 447ms (± 0.30%) 444ms (± 1.34%) ~ 436ms 448ms p=0.557 n=6
Req 5 - completionInfo count 3,450 3,450 ~ ~ ~ p=1.000 n=6
Req 5 - completionInfo 849ms (± 2.46%) 853ms (± 0.46%) ~ 846ms 857ms p=0.377 n=6
System info unknown
Hosts
  • node (v18.15.0, x64)
Scenarios
  • CompilerTSServer - node (v18.15.0, x64)
  • Compiler-UnionsTSServer - node (v18.15.0, x64)
  • xstate-main-1-tsserver - node (v18.15.0, x64)
Benchmark Name Iterations
Current pr 6
Baseline baseline 6

startup

Comparison Report - baseline..pr
Metric baseline pr Delta Best Worst p-value
tsc-startup - node (v18.15.0, x64)
Execution time 183.96ms (± 0.21%) 184.40ms (± 0.19%) +0.44ms (+ 0.24%) 182.10ms 188.22ms p=0.000 n=600
tsserver-startup - node (v18.15.0, x64)
Execution time 234.37ms (± 0.15%) 234.57ms (± 0.16%) +0.19ms (+ 0.08%) 233.12ms 241.80ms p=0.000 n=600
tsserverlibrary-startup - node (v18.15.0, x64)
Execution time 229.63ms (± 0.14%) 229.86ms (± 0.15%) +0.22ms (+ 0.10%) 228.36ms 235.93ms p=0.000 n=600
typescript-startup - node (v18.15.0, x64)
Execution time 228.58ms (± 0.14%) 228.72ms (± 0.15%) +0.14ms (+ 0.06%) 227.26ms 232.96ms p=0.000 n=600
System info unknown
Hosts
  • node (v18.15.0, x64)
Scenarios
  • tsc-startup - node (v18.15.0, x64)
  • tsserver-startup - node (v18.15.0, x64)
  • tsserverlibrary-startup - node (v18.15.0, x64)
  • typescript-startup - node (v18.15.0, x64)
Benchmark Name Iterations
Current pr 6
Baseline baseline 6

Developer Information:

Download Benchmarks

@gabritto gabritto changed the title Gabritto/d2 nocond Narrow generic conditional and indexed access return types when checking return statements, no conditional expression support Oct 18, 2024
@Andarist
Copy link
Contributor

@gabritto should this one perhaps be closed?

@gabritto gabritto closed this Dec 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Author: Team For Uncommitted Bug PR for untriaged, rejected, closed or missing bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants