Skip to content

Add nested call and new expressions as potential intra expression inference sites - #54183

Closed
Mateusz Burzyński (Andarist) wants to merge 15 commits into
microsoft:mainfrom
Andarist:fix/intra-expression-inference-with-resolved-calls
Closed

Add nested call and new expressions as potential intra expression inference sites#54183
Mateusz Burzyński (Andarist) wants to merge 15 commits into
microsoft:mainfrom
Andarist:fix/intra-expression-inference-with-resolved-calls

Conversation

@Andarist

@AndaristMateusz Burzyński (Andarist) commented May 8, 2023

Copy link
Copy Markdown
Contributor

Sometimes nested generic functions are skipped during inference in the first pass:
https://github.dev/microsoft/TypeScript/blob/04d4580f4eedc036b014ef4329cffe9979da3af9/src/compiler/checker.ts#L33619-L33634

However, those calls are resolved from within checkExpressionWithContextualType and by the time we have a chance to call addIntraExpressionInferenceSite they are already resolved. So it, imho, makes sense to actually use them as intra expression inference sites.

fixes#54184
fixes#52114
fixes#53776

@typescript-botTypeScript Bot (typescript-bot) added the For Uncommitted Bug PR for untriaged, rejected, closed or missing bug label May 8, 2023
@typescript-bot

Copy link
Copy Markdown
Contributor

This PR doesn't have any linked issues. Please open an issue that references this PR. From there we can discuss and prioritise.

@weswigham

Copy link
Copy Markdown
Member

@typescript-bot

TypeScript Bot (typescript-bot) commented May 24, 2023

Copy link
Copy Markdown
Contributor

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

Update: The results are in!

@typescript-bot

TypeScript Bot (typescript-bot) commented May 24, 2023

Copy link
Copy Markdown
Contributor

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

Update: The results are in!

@typescript-bot

TypeScript Bot (typescript-bot) commented May 24, 2023

Copy link
Copy Markdown
Contributor

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

Update: The results are in!

@typescript-bot

TypeScript Bot (typescript-bot) commented May 24, 2023

Copy link
Copy Markdown
Contributor

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

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.

This seems fine - iirc, needing to do a deeper traversal for context-sensitivity checking was something we've known for awhile, we've just been avoiding doing it in most of our other fixes, since we've been worried about the perf cost of a deeper tree traversal. Assuming perf comes back fine, only change I think I'd want is a deprecated isContextSensitive in the public API (which can just call the new function), so this isn't a hard API break.

@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) Here are the results of running the top-repos suite comparing main and refs/pull/54183/merge:

Everything looks good!

@typescript-bot

Copy link
Copy Markdown
Contributor

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

…inference-with-resolved-calls
# Conflicts:
#	src/compiler/checker.ts
#	tests/baselines/reference/intraExpressionInferences.errors.txt
#	tests/baselines/reference/intraExpressionInferences.js
#	tests/baselines/reference/intraExpressionInferences.symbols
#	tests/baselines/reference/intraExpressionInferences.types
#	tests/cases/conformance/types/typeRelationships/typeInference/intraExpressionInferences.ts
@Andarist

Copy link
Copy Markdown
ContributorAuthor

only change I think I'd want is a deprecated isContextSensitive in the public API (which can just call the new function), so this isn't a hard API break.

is this relevant for a function that is annotated with /** @internal */?

@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..54183
Metricmain54183DeltaBestWorstp-value
Angular - node (v18.10.0, x64)
Memory used365,796k (± 0.01%)365,968k (± 0.00%)+172k (+ 0.05%)365,947k365,988kp=0.005 n=6
Parse Time3.43s (± 0.57%)3.41s (± 0.70%)~3.37s3.43sp=0.286 n=6
Bind Time1.11s (± 0.73%)1.11s (± 0.46%)~1.11s1.12sp=0.929 n=6
Check Time8.74s (± 0.30%)8.74s (± 0.33%)~8.70s8.78sp=0.629 n=6
Emit Time7.44s (± 0.24%)7.43s (± 0.45%)~7.38s7.47sp=0.934 n=6
Total Time20.73s (± 0.21%)20.69s (± 0.29%)~20.61s20.76sp=0.336 n=6
Compiler-Unions - node (v18.10.0, x64)
Memory used193,058k (± 1.50%)192,000k (± 1.24%)~190,998k196,871kp=0.066 n=6
Parse Time1.50s (± 1.40%)1.50s (± 1.15%)~1.47s1.52sp=0.807 n=6
Bind Time0.77s (± 0.00%)0.77s (± 0.00%)~0.77s0.77sp=1.000 n=6
Check Time9.49s (± 0.42%)9.63s (± 0.44%)+0.14s (+ 1.47%)9.59s9.69sp=0.005 n=6
Emit Time2.73s (± 0.64%)2.75s (± 0.84%)~2.72s2.78sp=0.225 n=6
Total Time14.50s (± 0.42%)14.65s (± 0.26%)+0.15s (+ 1.03%)14.59s14.70sp=0.006 n=6
Monaco - node (v18.10.0, x64)
Memory used346,604k (± 0.01%)346,562k (± 0.00%)-42k (- 0.01%)346,550k346,576kp=0.013 n=6
Parse Time2.60s (± 1.41%)2.58s (± 1.26%)~2.54s2.63sp=0.464 n=6
Bind Time1.00s (± 0.81%)1.01s (± 0.83%)~1.00s1.02sp=0.673 n=6
Check Time7.14s (± 0.43%)7.18s (± 0.26%)~7.16s7.21sp=0.086 n=6
Emit Time4.25s (± 0.33%)4.26s (± 1.02%)~4.21s4.32sp=0.808 n=6
Total Time14.99s (± 0.20%)15.02s (± 0.49%)~14.93s15.13sp=0.630 n=6
TFS - node (v18.10.0, x64)
Memory used300,604k (± 0.00%)300,763k (± 0.01%)+159k (+ 0.05%)300,735k300,794kp=0.005 n=6
Parse Time2.06s (± 1.12%)2.06s (± 1.05%)~2.02s2.08sp=0.788 n=6
Bind Time1.14s (± 0.73%)1.14s (± 0.86%)~1.12s1.15sp=0.340 n=6
Check Time6.62s (± 0.74%)6.63s (± 0.66%)~6.56s6.69sp=0.872 n=6
Emit Time3.87s (± 0.93%)3.88s (± 0.53%)~3.85s3.91sp=0.421 n=6
Total Time13.70s (± 0.40%)13.72s (± 0.40%)~13.65s13.78sp=0.376 n=6
material-ui - node (v18.10.0, x64)
Memory used481,752k (± 0.01%)482,344k (± 0.01%)+592k (+ 0.12%)482,285k482,377kp=0.005 n=6
Parse Time3.10s (± 0.44%)3.12s (± 0.72%)~3.10s3.16sp=0.101 n=6
Bind Time0.92s (± 1.66%)0.91s (± 0.56%)~0.91s0.92sp=1.000 n=6
Check Time16.78s (± 0.41%)16.95s (± 0.56%)+0.17s (+ 1.02%)16.83s17.07sp=0.010 n=6
Emit Time0.00s (± 0.00%)0.00s (± 0.00%)~0.00s0.00sp=1.000 n=6
Total Time20.80s (± 0.39%)20.99s (± 0.47%)+0.19s (+ 0.89%)20.85s21.12sp=0.013 n=6
xstate - node (v18.10.0, x64)
Memory used563,021k (± 0.02%)562,733k (± 0.02%)-289k (- 0.05%)562,621k562,918kp=0.008 n=6
Parse Time3.82s (± 0.46%)3.85s (± 0.67%)~3.81s3.87sp=0.106 n=6
Bind Time1.63s (± 0.63%)1.63s (± 0.34%)~1.62s1.63sp=0.663 n=6
Check Time2.82s (± 0.77%)2.82s (± 0.85%)~2.80s2.86sp=0.936 n=6
Emit Time0.08s (± 0.00%)0.08s (± 0.00%)~0.08s0.08sp=1.000 n=6
Total Time8.35s (± 0.40%)8.37s (± 0.58%)~8.32s8.44sp=0.520 n=6
Angular - node (v16.17.1, x64)
Memory used365,269k (± 0.00%)365,327k (± 0.01%)~365,247k365,377kp=0.066 n=6
Parse Time3.58s (± 0.73%)3.54s (± 0.55%)-0.04s (- 1.07%)3.52s3.57sp=0.030 n=6
Bind Time1.19s (± 0.69%)1.17s (± 0.44%)-0.01s (- 1.12%)1.17s1.18sp=0.014 n=6
Check Time9.61s (± 0.31%)9.58s (± 0.39%)~9.53s9.63sp=0.199 n=6
Emit Time7.99s (± 0.82%)7.92s (± 0.58%)-0.07s (- 0.94%)7.87s8.00sp=0.044 n=6
Total Time22.36s (± 0.21%)22.21s (± 0.42%)-0.16s (- 0.69%)22.10s22.37sp=0.016 n=6
Compiler-Unions - node (v16.17.1, x64)
Memory used192,883k (± 0.03%)193,224k (± 0.53%)~192,742k195,332kp=0.230 n=6
Parse Time1.59s (± 0.76%)1.59s (± 1.52%)~1.55s1.62sp=0.744 n=6
Bind Time0.83s (± 0.49%)0.83s (± 0.66%)~0.82s0.83sp=0.282 n=6
Check Time10.25s (± 0.53%)10.31s (± 0.29%)~10.26s10.34sp=0.053 n=6
Emit Time3.00s (± 0.70%)3.05s (± 1.46%)+0.05s (+ 1.72%)3.01s3.13sp=0.030 n=6
Total Time15.67s (± 0.40%)15.78s (± 0.35%)+0.12s (+ 0.73%)15.68s15.83sp=0.020 n=6
Monaco - node (v16.17.1, x64)
Memory used345,874k (± 0.00%)345,862k (± 0.00%)~345,854k345,870kp=0.297 n=6
Parse Time2.73s (± 0.38%)2.72s (± 0.28%)-0.01s (- 0.49%)2.71s2.73sp=0.046 n=6
Bind Time1.09s (± 0.75%)1.09s (± 0.00%)~1.09s1.09sp=0.290 n=6
Check Time7.83s (± 0.33%)7.90s (± 0.37%)+0.07s (+ 0.89%)7.86s7.94sp=0.008 n=6
Emit Time4.46s (± 1.15%)4.50s (± 0.81%)~4.45s4.54sp=0.198 n=6
Total Time16.11s (± 0.45%)16.21s (± 0.36%)+0.10s (+ 0.64%)16.14s16.29sp=0.037 n=6
TFS - node (v16.17.1, x64)
Memory used299,938k (± 0.01%)300,109k (± 0.00%)+171k (+ 0.06%)300,097k300,131kp=0.005 n=6
Parse Time2.16s (± 0.48%)2.16s (± 0.59%)~2.14s2.17sp=0.868 n=6
Bind Time1.24s (± 0.99%)1.24s (± 0.61%)~1.23s1.25sp=0.388 n=6
Check Time7.26s (± 0.46%)7.32s (± 0.37%)+0.05s (+ 0.71%)7.28s7.35sp=0.020 n=6
Emit Time4.33s (± 0.66%)4.40s (± 0.44%)+0.07s (+ 1.54%)4.38s4.43sp=0.005 n=6
Total Time15.00s (± 0.40%)15.11s (± 0.20%)+0.12s (+ 0.78%)15.06s15.15sp=0.005 n=6
material-ui - node (v16.17.1, x64)
Memory used480,973k (± 0.01%)481,627k (± 0.01%)+653k (+ 0.14%)481,560k481,705kp=0.005 n=6
Parse Time3.28s (± 1.34%)3.24s (± 0.28%)~3.23s3.25sp=0.061 n=6
Bind Time0.95s (± 1.59%)0.94s (± 0.55%)~0.93s0.94sp=0.242 n=6
Check Time18.03s (± 1.20%)17.95s (± 0.79%)~17.78s18.17sp=0.575 n=6
Emit Time0.00s (± 0.00%)0.00s (± 0.00%)~0.00s0.00sp=1.000 n=6
Total Time22.25s (± 0.99%)22.13s (± 0.66%)~21.95s22.36sp=0.336 n=6
xstate - node (v16.17.1, x64)
Memory used560,656k (± 0.01%)560,513k (± 0.03%)~560,321k560,822kp=0.066 n=6
Parse Time4.00s (± 0.41%)4.00s (± 0.21%)~3.99s4.01sp=0.731 n=6
Bind Time1.77s (± 0.50%)1.76s (± 0.36%)~1.75s1.77sp=0.070 n=6
Check Time3.06s (± 0.56%)3.06s (± 0.68%)~3.03s3.09sp=0.809 n=6
Emit Time0.09s (± 0.00%)0.09s (± 0.00%)~0.09s0.09sp=1.000 n=6
Total Time8.92s (± 0.36%)8.92s (± 0.28%)~8.87s8.94sp=0.746 n=6
Angular - node (v14.21.3, x64)
Memory used359,205k (± 0.01%)359,413k (± 0.00%)+208k (+ 0.06%)359,385k359,435kp=0.005 n=6
Parse Time3.68s (± 0.63%)3.67s (± 0.28%)~3.65s3.68sp=0.220 n=6
Bind Time1.22s (± 0.42%)1.22s (± 0.42%)~1.21s1.22sp=1.000 n=6
Check Time10.01s (± 0.79%)10.05s (± 0.49%)~9.99s10.11sp=0.336 n=6
Emit Time8.33s (± 0.94%)8.30s (± 0.87%)~8.23s8.40sp=0.574 n=6
Total Time23.24s (± 0.68%)23.23s (± 0.46%)~23.12s23.40sp=0.810 n=6
Compiler-Unions - node (v14.21.3, x64)
Memory used188,287k (± 0.01%)188,145k (± 0.01%)-143k (- 0.08%)188,114k188,164kp=0.005 n=6
Parse Time1.62s (± 0.72%)1.61s (± 1.11%)~1.59s1.64sp=0.192 n=6
Bind Time0.85s (± 0.74%)0.85s (± 0.89%)~0.84s0.86sp=0.718 n=6
Check Time10.30s (± 0.70%)10.42s (± 0.64%)+0.11s (+ 1.08%)10.34s10.53sp=0.036 n=6
Emit Time3.13s (± 0.90%)3.16s (± 0.87%)~3.13s3.21sp=0.192 n=6
Total Time15.91s (± 0.54%)16.04s (± 0.39%)+0.12s (+ 0.76%)15.93s16.11sp=0.019 n=6
Monaco - node (v14.21.3, x64)
Memory used341,023k (± 0.00%)340,935k (± 0.00%)-88k (- 0.03%)340,914k340,954kp=0.005 n=6
Parse Time2.82s (± 0.72%)2.79s (± 0.37%)-0.03s (- 0.95%)2.78s2.81sp=0.014 n=6
Bind Time1.11s (± 0.80%)1.11s (± 0.57%)~1.10s1.12sp=1.000 n=6
Check Time8.15s (± 0.59%)8.18s (± 0.36%)~8.15s8.23sp=0.146 n=6
Emit Time4.67s (± 1.09%)4.73s (± 0.80%)~4.70s4.80sp=0.052 n=6
Total Time16.75s (± 0.51%)16.82s (± 0.32%)~16.75s16.90sp=0.108 n=6
TFS - node (v14.21.3, x64)
Memory used295,139k (± 0.00%)295,288k (± 0.00%)+149k (+ 0.05%)295,273k295,305kp=0.005 n=6
Parse Time2.41s (± 0.61%)2.40s (± 0.61%)~2.39s2.42sp=0.408 n=6
Bind Time1.06s (± 0.38%)1.07s (± 0.38%)+0.01s (+ 0.63%)1.06s1.07sp=0.034 n=6
Check Time7.59s (± 0.34%)7.59s (± 0.55%)~7.55s7.66sp=1.000 n=6
Emit Time4.30s (± 0.55%)4.34s (± 0.82%)+0.04s (+ 0.97%)4.31s4.41sp=0.036 n=6
Total Time15.36s (± 0.28%)15.40s (± 0.31%)~15.33s15.45sp=0.109 n=6
material-ui - node (v14.21.3, x64)
Memory used476,562k (± 0.01%)477,199k (± 0.01%)+637k (+ 0.13%)477,164k477,247kp=0.005 n=6
Parse Time3.33s (± 0.45%)3.32s (± 0.52%)~3.30s3.35sp=0.191 n=6
Bind Time1.01s (± 0.81%)1.00s (± 0.75%)~0.99s1.01sp=0.383 n=6
Check Time18.74s (± 0.70%)18.77s (± 0.63%)~18.65s18.97sp=0.630 n=6
Emit Time0.00s (± 0.00%)0.00s (± 0.00%)~0.00s0.00sp=1.000 n=6
Total Time23.08s (± 0.60%)23.09s (± 0.59%)~22.97s23.34sp=1.000 n=6
xstate - node (v14.21.3, x64)
Memory used549,594k (± 0.00%)549,362k (± 0.00%)-232k (- 0.04%)549,345k549,376kp=0.005 n=6
Parse Time4.29s (± 0.96%)4.22s (± 0.43%)-0.07s (- 1.67%)4.19s4.24sp=0.005 n=6
Bind Time1.65s (± 3.72%)1.66s (± 2.01%)~1.59s1.68sp=0.412 n=6
Check Time3.17s (± 0.78%)3.17s (± 0.52%)~3.16s3.20sp=0.936 n=6
Emit Time0.09s (± 5.53%)0.09s (± 0.00%)~0.09s0.09sp=0.174 n=6
Total Time9.21s (± 0.39%)9.14s (± 0.47%)-0.07s (- 0.72%)9.06s9.19sp=0.012 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)
BenchmarkNameIterations
Current541836
Baselinemain6

TSServer

Comparison Report - main..54183
Metricmain54183DeltaBestWorstp-value
Compiler-UnionsTSServer - node (v18.10.0, x64)
Req 1 - updateOpen2,542ms (± 0.52%)2,546ms (± 0.81%)~2,528ms2,583msp=0.936 n=6
Req 2 - geterr5,557ms (± 0.81%)5,638ms (± 1.39%)~5,491ms5,706msp=0.066 n=6
Req 3 - references337ms (± 1.59%)341ms (± 0.73%)~336ms343msp=0.127 n=6
Req 4 - navto290ms (± 1.21%)284ms (± 1.00%)-5ms (- 1.84%)283ms290msp=0.030 n=6
Req 5 - completionInfo count1,356 (± 0.00%)1,356 (± 0.00%)~1,3561,356p=1.000 n=6
Req 5 - completionInfo85ms (± 1.05%)83ms (± 5.12%)~74ms85msp=0.114 n=6
CompilerTSServer - node (v18.10.0, x64)
Req 1 - updateOpen2,664ms (± 0.60%)2,638ms (± 0.69%)~2,602ms2,655msp=0.054 n=6
Req 2 - geterr4,295ms (± 0.37%)4,353ms (± 0.35%)+58ms (+ 1.35%)4,337ms4,371msp=0.005 n=6
Req 3 - references350ms (± 0.28%)349ms (± 0.23%)~348ms350msp=0.065 n=6
Req 4 - navto292ms (± 0.64%)290ms (± 0.18%)~290ms291msp=0.211 n=6
Req 5 - completionInfo count1,518 (± 0.00%)1,518 (± 0.00%)~1,5181,518p=1.000 n=6
Req 5 - completionInfo64ms (± 5.55%)62ms (± 0.66%)~62ms63msp=0.248 n=6
xstateTSServer - node (v18.10.0, x64)
Req 1 - updateOpen3,082ms (± 0.88%)3,075ms (± 0.52%)~3,044ms3,090msp=0.689 n=6
Req 2 - geterr1,559ms (± 0.68%)1,587ms (± 1.38%)+28ms (+ 1.81%)1,555ms1,622msp=0.037 n=6
Req 3 - references115ms (± 2.12%)108ms (± 1.36%)🟩-7ms (- 5.82%)106ms110msp=0.005 n=6
Req 4 - navto360ms (± 0.58%)363ms (± 0.32%)+4ms (+ 1.02%)362ms365msp=0.018 n=6
Req 5 - completionInfo count2,862 (± 0.00%)2,862 (± 0.00%)~2,8622,862p=1.000 n=6
Req 5 - completionInfo376ms (± 2.24%)378ms (± 1.28%)~372ms385msp=0.520 n=6
Compiler-UnionsTSServer - node (v16.17.1, x64)
Req 1 - updateOpen2,653ms (± 0.76%)2,673ms (± 0.63%)~2,644ms2,692msp=0.077 n=6
Req 2 - geterr6,041ms (± 0.38%)6,135ms (± 0.50%)+94ms (+ 1.55%)6,093ms6,180msp=0.005 n=6
Req 3 - references351ms (± 0.69%)353ms (± 0.53%)~350ms355msp=0.368 n=6
Req 4 - navto292ms (± 1.34%)283ms (± 0.98%)-9ms (- 2.97%)278ms286msp=0.005 n=6
Req 5 - completionInfo count1,356 (± 0.00%)1,356 (± 0.00%)~1,3561,356p=1.000 n=6
Req 5 - completionInfo93ms (± 0.59%)85ms (± 6.27%)🟩-7ms (- 7.93%)81ms92msp=0.015 n=6
CompilerTSServer - node (v16.17.1, x64)
Req 1 - updateOpen2,836ms (± 0.44%)2,828ms (± 0.27%)~2,818ms2,840msp=0.199 n=6
Req 2 - geterr4,631ms (± 0.43%)4,694ms (± 0.11%)+63ms (+ 1.35%)4,688ms4,702msp=0.005 n=6
Req 3 - references367ms (± 0.57%)363ms (± 0.46%)-4ms (- 0.95%)361ms365msp=0.015 n=6
Req 4 - navto285ms (± 1.14%)285ms (± 1.03%)~282ms289msp=0.871 n=6
Req 5 - completionInfo count1,518 (± 0.00%)1,518 (± 0.00%)~1,5181,518p=1.000 n=6
Req 5 - completionInfo67ms (± 0.77%)67ms (± 1.12%)~66ms68msp=0.784 n=6
xstateTSServer - node (v16.17.1, x64)
Req 1 - updateOpen3,228ms (± 0.48%)3,210ms (± 0.49%)~3,192ms3,233msp=0.173 n=6
Req 2 - geterr1,755ms (± 1.08%)1,744ms (± 0.48%)~1,733ms1,752msp=0.173 n=6
Req 3 - references129ms (± 8.26%)123ms (± 0.99%)~121ms124msp=0.371 n=6
Req 4 - navto342ms (± 0.47%)343ms (± 0.31%)~341ms344msp=0.508 n=6
Req 5 - completionInfo count2,862 (± 0.00%)2,862 (± 0.00%)~2,8622,862p=1.000 n=6
Req 5 - completionInfo410ms (± 1.69%)403ms (± 0.66%)~398ms405msp=0.124 n=6
Compiler-UnionsTSServer - node (v14.21.3, x64)
Req 1 - updateOpen2,806ms (± 0.55%)2,785ms (± 0.32%)-21ms (- 0.76%)2,772ms2,795msp=0.020 n=6
Req 2 - geterr6,181ms (± 0.46%)6,346ms (± 0.55%)+164ms (+ 2.66%)6,301ms6,399msp=0.005 n=6
Req 3 - references363ms (± 0.62%)368ms (± 1.49%)+5ms (+ 1.47%)363ms378msp=0.034 n=6
Req 4 - navto291ms (± 0.81%)291ms (± 0.47%)~289ms293msp=0.618 n=6
Req 5 - completionInfo count1,356 (± 0.00%)1,356 (± 0.00%)~1,3561,356p=1.000 n=6
Req 5 - completionInfo99ms (± 4.25%)101ms (± 4.85%)~92ms105msp=0.366 n=6
CompilerTSServer - node (v14.21.3, x64)
Req 1 - updateOpen2,975ms (± 1.09%)2,967ms (± 0.45%)~2,945ms2,983msp=0.748 n=6
Req 2 - geterr4,527ms (± 0.85%)4,577ms (± 0.30%)+50ms (+ 1.10%)4,557ms4,590msp=0.031 n=6
Req 3 - references377ms (± 1.22%)378ms (± 0.99%)~374ms383msp=0.629 n=6
Req 4 - navto299ms (± 0.30%)297ms (± 0.65%)~295ms300msp=0.061 n=6
Req 5 - completionInfo count1,518 (± 0.00%)1,518 (± 0.00%)~1,5181,518p=1.000 n=6
Req 5 - completionInfo76ms (± 0.83%)76ms (± 0.54%)~76ms77msp=0.673 n=6
xstateTSServer - node (v14.21.3, x64)
Req 1 - updateOpen3,503ms (± 1.32%)3,480ms (± 1.13%)~3,430ms3,534msp=0.298 n=6
Req 2 - geterr1,845ms (± 0.71%)1,845ms (± 0.55%)~1,831ms1,857msp=0.688 n=6
Req 3 - references154ms (± 5.49%)154ms (± 6.10%)~137ms162msp=0.936 n=6
Req 4 - navto395ms (± 1.13%)395ms (± 1.68%)~387ms407msp=0.677 n=6
Req 5 - completionInfo count2,862 (± 0.00%)2,862 (± 0.00%)~2,8622,862p=1.000 n=6
Req 5 - completionInfo430ms (± 0.89%)432ms (± 2.20%)~413ms439msp=0.223 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)
BenchmarkNameIterations
Current541836
Baselinemain6

Startup

Comparison Report - main..54183
Metricmain54183DeltaBestWorstp-value
tsc-startup - node (v16.17.1, x64)
Execution time141.97ms (± 0.18%)141.50ms (± 0.23%)-0.46ms (- 0.33%)140.84ms151.65msp=0.000 n=600
tsserver-startup - node (v16.17.1, x64)
Execution time220.97ms (± 0.22%)220.58ms (± 0.19%)-0.39ms (- 0.18%)219.59ms227.99msp=0.000 n=600
tsserverlibrary-startup - node (v16.17.1, x64)
Execution time223.64ms (± 0.36%)222.62ms (± 0.30%)-1.02ms (- 0.46%)220.84ms234.65msp=0.000 n=600
typescript-startup - node (v16.17.1, x64)
Execution time206.57ms (± 0.37%)204.89ms (± 0.31%)-1.68ms (- 0.82%)202.90ms209.99msp=0.000 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)
BenchmarkNameIterations
Current541836
Baselinemain6

Developer Information:

Download Benchmark

…inference-with-resolved-calls
# Conflicts:
#	src/compiler/checker.ts
…inference-with-resolved-calls
# Conflicts:
#	src/compiler/checker.ts
#	tests/baselines/reference/intraExpressionInferences.errors.txt
#	tests/baselines/reference/intraExpressionInferences.js
#	tests/baselines/reference/intraExpressionInferences.symbols
#	tests/baselines/reference/intraExpressionInferences.types
#	tests/cases/conformance/types/typeRelationships/typeInference/intraExpressionInferences.ts
@Andarist
Mateusz Burzyński (Andarist)force-pushed the fix/intra-expression-inference-with-resolved-calls branch from 68e3c49 to bfdaa86CompareJanuary 12, 2024 12:08
@weswigham

Copy link
Copy Markdown
Member

TypeScript Bot (@typescript-bot) perf test public

@typescript-bot

TypeScript Bot (typescript-bot) commented Jan 16, 2024

Copy link
Copy Markdown
Contributor

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

Update: The results are in!

@typescript-bot

Copy link
Copy Markdown
Contributor

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

Here they are:

tsc

Comparison Report - baseline..pr
MetricbaselineprDeltaBestWorstp-value
mui-docs - node (v20.5.1, x64)
Memory used1,730,098k (± 0.00%)1,730,081k (± 0.00%)~1,730,041k1,730,110kp=0.298 n=6
Parse Time6.79s (± 0.22%)6.80s (± 0.44%)~6.75s6.84sp=0.511 n=6
Bind Time2.42s (± 1.75%)2.39s (± 1.42%)~2.33s2.42sp=0.226 n=6
Check Time52.41s (± 0.47%)52.20s (± 0.45%)~51.97s52.53sp=0.199 n=6
Emit Time0.15s (± 0.00%)0.15s (± 2.69%)~0.15s0.16sp=0.405 n=6
Total Time61.77s (± 0.46%)61.53s (± 0.39%)~61.29s61.84sp=0.199 n=6
self-build-src - node (v20.5.1, x64)
Memory used2,602,454k (± 2.30%)2,717,879k (± 8.18%)~2,576,888k3,072,191kp=0.810 n=6
Parse Time5.05s (± 1.06%)5.06s (± 0.41%)~5.04s5.09sp=1.000 n=6
Bind Time1.96s (± 0.42%)1.96s (± 1.18%)~1.92s1.99sp=0.282 n=6
Check Time32.27s (± 0.54%)32.18s (± 0.28%)~32.04s32.27sp=0.688 n=6
Emit Time2.76s (± 3.49%)2.75s (± 1.33%)~2.71s2.79sp=0.688 n=6
Total Time42.07s (± 0.54%)41.96s (± 0.26%)~41.77s42.10sp=0.575 n=6
self-compiler - node (v20.5.1, x64)
Memory used419,318k (± 0.01%)419,377k (± 0.02%)~419,307k419,495kp=0.093 n=6
Parse Time2.89s (± 0.74%)2.88s (± 0.52%)~2.87s2.90sp=0.564 n=6
Bind Time1.13s (± 0.46%)1.13s (± 0.48%)~1.13s1.14sp=0.640 n=6
Check Time14.15s (± 0.29%)14.16s (± 0.59%)~14.02s14.24sp=0.630 n=6
Emit Time1.03s (± 0.73%)1.03s (± 0.87%)~1.02s1.04sp=0.798 n=6
Total Time19.20s (± 0.20%)19.21s (± 0.43%)~19.08s19.31sp=0.686 n=6
vscode - node (v20.5.1, x64)
Memory used2,841,130k (± 0.00%)2,841,091k (± 0.00%)~2,841,040k2,841,154kp=0.575 n=6
Parse Time10.78s (± 0.14%)10.79s (± 0.48%)~10.74s10.89sp=0.464 n=6
Bind Time3.46s (± 0.62%)3.44s (± 0.45%)~3.43s3.47sp=0.162 n=6
Check Time56.59s (± 0.20%)56.82s (± 0.51%)~56.51s57.19sp=0.173 n=6
Emit Time16.30s (± 0.43%)16.23s (± 0.28%)~16.15s16.26sp=0.126 n=6
Total Time87.12s (± 0.16%)87.28s (± 0.33%)~86.95s87.66sp=0.471 n=6
webpack - node (v20.5.1, x64)
Memory used395,259k (± 0.01%)395,243k (± 0.00%)~395,215k395,256kp=0.297 n=6
Parse Time3.33s (± 0.73%)3.32s (± 0.38%)~3.30s3.34sp=0.340 n=6
Bind Time1.44s (± 0.76%)1.45s (± 0.75%)~1.44s1.47sp=0.111 n=6
Check Time12.95s (± 0.14%)12.92s (± 0.25%)~12.89s12.97sp=0.089 n=6
Emit Time0.00s (± 0.00%)0.00s (± 0.00%)~0.00s0.00sp=1.000 n=6
Total Time17.73s (± 0.22%)17.69s (± 0.20%)~17.65s17.75sp=0.172 n=6
System info unknown
Hosts
  • node (v20.5.1, x64)
Scenarios
  • mui-docs - node (v20.5.1, x64)
  • self-build-src - node (v20.5.1, x64)
  • self-compiler - node (v20.5.1, x64)
  • vscode - node (v20.5.1, x64)
  • webpack - node (v20.5.1, x64)
BenchmarkNameIterations
Currentpr6
Baselinebaseline6

Developer Information:

Download Benchmarks

@weswigham

Copy link
Copy Markdown
Member

@typescript-bot

TypeScript Bot (typescript-bot) commented Jan 16, 2024

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 bfdaa86. You can monitor the build here.

Update: The results are in!

@Andarist

Copy link
Copy Markdown
ContributorAuthor

The reported failures here are addressed by #57909 . I believe this isn't a new issue here - it just surfaced here by the fact that more inference sites are considered. One could rewrite those call sites slightly to end up with the same broken results today.

@Andarist

Copy link
Copy Markdown
ContributorAuthor

#57909 was merged so the issue above is resolved now. Jake Bailey (@jakebailey) could you re-run top800 and other important tests here? Daniel Rosenwasser (@DanielRosenwasser)Wesley Wigham (@weswigham) could I ask for another review? :)

@jakebailey

Copy link
Copy Markdown
Member

TypeScript Bot (@typescript-bot) perf test this
TypeScript Bot (@typescript-bot) test top800
TypeScript Bot (@typescript-bot) user test this
TypeScript Bot (@typescript-bot) run dt

@typescript-bot

TypeScript Bot (typescript-bot) commented Jun 18, 2024

Copy link
Copy Markdown
Contributor

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

CommandStatusResults
perf test this✅ Started👀 Results
test top800✅ Started✅ Results
user test this✅ Started✅ Results
run dt✅ Started✅ Results

@typescript-bot

Copy link
Copy Markdown
Contributor

Hey Jake Bailey (@jakebailey), the results of running the DT tests are ready.

Everything looks the same!

You can check the log here.

@typescript-bot

Copy link
Copy Markdown
Contributor

Jake Bailey (@jakebailey) Here are the results of running the user tests with tsc comparing main and refs/pull/54183/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:

tsc

Comparison Report - baseline..pr
MetricbaselineprDeltaBestWorstp-value
Compiler-Unions - node (v18.15.0, x64)
Errors3030~~~p=1.000 n=6
Symbols62,15362,153~~~p=1.000 n=6
Types50,24250,242~~~p=1.000 n=6
Memory used193,235k (± 0.86%)192,898k (± 0.76%)~192,028k195,863kp=0.575 n=6
Parse Time1.96s (± 1.24%)1.95s (± 0.96%)~1.92s1.97sp=0.935 n=6
Bind Time1.06s (± 0.97%)1.06s (± 1.19%)~1.05s1.08sp=0.560 n=6
Check Time13.93s (± 0.32%)13.92s (± 0.49%)~13.84s14.00sp=1.000 n=6
Emit Time4.00s (± 0.29%)4.08s (± 3.60%)~3.99s4.38sp=0.088 n=6
Total Time20.95s (± 0.19%)21.02s (± 0.99%)~20.84s21.42sp=0.468 n=6
angular-1 - node (v18.15.0, x64)
Errors55~~~p=1.000 n=6
Symbols944,114944,114~~~p=1.000 n=6
Types407,051407,051~~~p=1.000 n=6
Memory used1,218,283k (± 0.01%)1,218,337k (± 0.00%)~1,218,280k1,218,381kp=0.173 n=6
Parse Time7.94s (± 0.48%)7.94s (± 0.65%)~7.86s8.02sp=1.000 n=6
Bind Time2.23s (± 0.72%)2.23s (± 0.54%)~2.22s2.25sp=0.935 n=6
Check Time35.84s (± 0.21%)35.89s (± 0.40%)~35.64s36.02sp=0.378 n=6
Emit Time16.18s (± 0.11%)16.20s (± 0.33%)~16.12s16.27sp=0.518 n=6
Total Time62.19s (± 0.13%)62.26s (± 0.22%)~62.01s62.38sp=0.229 n=6
mui-docs - node (v18.15.0, x64)
Errors00~~~p=1.000 n=6
Symbols2,132,3102,132,310~~~p=1.000 n=6
Types926,699926,699~~~p=1.000 n=6
Memory used2,115,235k (± 0.01%)2,115,194k (± 0.00%)~2,115,087k2,115,326kp=0.378 n=6
Parse Time7.88s (± 0.76%)7.88s (± 0.29%)~7.85s7.91sp=1.000 n=6
Bind Time2.75s (± 0.68%)2.76s (± 0.37%)~2.75s2.78sp=0.289 n=6
Check Time84.22s (± 0.48%)83.98s (± 0.35%)~83.60s84.37sp=0.336 n=6
Emit Time0.16s (± 5.21%)0.16s (± 3.29%)~0.15s0.16sp=0.929 n=6
Total Time95.01s (± 0.39%)94.78s (± 0.29%)~94.44s95.18sp=0.230 n=6
self-build-src - node (v18.15.0, x64)
Errors00~~~p=1.000 n=6
Symbols1,231,0801,231,102+22 (+ 0.00%)~~p=0.001 n=6
Types261,267261,276+9 (+ 0.00%)~~p=0.001 n=6
Memory used2,356,170k (± 1.02%)2,345,851k (± 0.04%)~2,345,023k2,347,387kp=0.128 n=6
Parse Time5.95s (± 1.10%)5.99s (± 0.55%)~5.95s6.03sp=0.261 n=6
Bind Time2.27s (± 0.67%)2.27s (± 0.78%)~2.24s2.28sp=0.467 n=6
Check Time39.84s (± 0.24%)39.93s (± 0.19%)~39.87s40.06sp=0.128 n=6
Emit Time3.26s (± 2.01%)3.23s (± 3.49%)~3.05s3.37sp=0.748 n=6
Total Time51.32s (± 0.23%)51.43s (± 0.28%)~51.31s51.70sp=0.298 n=6
self-build-src-public-api - node (v18.15.0, x64)
Errors00~~~p=1.000 n=6
Symbols1,231,0801,231,102+22 (+ 0.00%)~~p=0.001 n=6
Types261,267261,276+9 (+ 0.00%)~~p=0.001 n=6
Memory used2,433,290k (± 0.98%)2,422,033k (± 0.05%)-11,257k (- 0.46%)2,420,886k2,423,728kp=0.045 n=6
Parse Time6.26s (± 0.75%)6.24s (± 1.07%)~6.14s6.33sp=0.748 n=6
Bind Time2.01s (± 0.73%)2.01s (± 1.20%)~1.99s2.05sp=0.936 n=6
Check Time40.28s (± 0.19%)40.34s (± 0.18%)~40.25s40.43sp=0.170 n=6
Emit Time3.09s (± 1.72%)3.22s (± 2.05%)🔻+0.13s (+ 4.21%)3.14s3.32sp=0.008 n=6
Total Time51.66s (± 0.25%)51.84s (± 0.14%)+0.18s (+ 0.34%)51.75s51.94sp=0.031 n=6
self-compiler - node (v18.15.0, x64)
Errors00~~~p=1.000 n=6
Symbols258,682258,704+22 (+ 0.01%)~~p=0.001 n=6
Types104,901104,910+9 (+ 0.01%)~~p=0.001 n=6
Memory used428,284k (± 0.01%)428,384k (± 0.00%)+100k (+ 0.02%)428,364k428,398kp=0.005 n=6
Parse Time3.32s (± 0.90%)3.31s (± 1.00%)~3.27s3.35sp=0.809 n=6
Bind Time1.30s (± 1.15%)1.31s (± 0.68%)~1.30s1.32sp=0.456 n=6
Check Time17.82s (± 0.24%)17.79s (± 0.40%)~17.73s17.92sp=0.261 n=6
Emit Time1.38s (± 1.65%)1.37s (± 1.35%)~1.35s1.40sp=0.625 n=6
Total Time23.82s (± 0.23%)23.78s (± 0.23%)~23.71s23.86sp=0.335 n=6
ts-pre-modules - node (v18.15.0, x64)
Errors3535~~~p=1.000 n=6
Symbols224,565224,565~~~p=1.000 n=6
Types93,73493,734~~~p=1.000 n=6
Memory used369,490k (± 0.03%)369,491k (± 0.01%)~369,400k369,526kp=0.689 n=6
Parse Time2.77s (± 0.90%)2.77s (± 0.80%)~2.74s2.79sp=0.934 n=6
Bind Time1.61s (± 2.25%)1.59s~~~p=0.176 n=6
Check Time15.51s (± 0.38%)15.52s (± 0.40%)~15.44s15.63sp=1.000 n=6
Emit Time0.00s0.00s~~~p=1.000 n=6
Total Time19.88s (± 0.32%)19.88s (± 0.40%)~19.76s20.01sp=0.686 n=6
vscode - node (v18.15.0, x64)
Errors00~~~p=1.000 n=6
Symbols2,864,8692,864,869~~~p=1.000 n=6
Types970,520970,520~~~p=1.000 n=6
Memory used3,027,534k (± 0.00%)3,027,500k (± 0.00%)~3,027,356k3,027,556kp=0.936 n=6
Parse Time16.64s (± 0.24%)16.63s (± 0.26%)~16.57s16.70sp=0.810 n=6
Bind Time5.05s (± 0.41%)5.04s (± 0.50%)~4.99s5.06sp=0.289 n=6
Check Time88.73s (± 0.49%)88.39s (± 0.59%)~87.95s89.33sp=0.230 n=6
Emit Time29.43s (± 0.80%)29.20s (± 0.84%)~28.92s29.60sp=0.093 n=6
Total Time139.86s (± 0.37%)139.25s (± 0.58%)~138.50s140.69sp=0.173 n=6
webpack - node (v18.15.0, x64)
Errors00~~~p=1.000 n=6
Symbols266,914266,914~~~p=1.000 n=6
Types108,685108,685~~~p=1.000 n=6
Memory used411,321k (± 0.03%)411,251k (± 0.01%)~411,216k411,274kp=0.298 n=6
Parse Time3.16s (± 0.35%)3.16s (± 0.26%)~3.15s3.17sp=0.666 n=6
Bind Time1.41s (± 0.59%)1.41s~~~p=0.176 n=6
Check Time14.27s (± 0.36%)14.27s (± 0.33%)~14.20s14.32sp=0.936 n=6
Emit Time0.00s0.00s~~~p=1.000 n=6
Total Time18.84s (± 0.26%)18.85s (± 0.23%)~18.78s18.90sp=1.000 n=6
xstate-main - node (v18.15.0, x64)
Errors00~~~p=1.000 n=6
Symbols523,694523,744+50 (+ 0.01%)~~p=0.001 n=6
Types178,007178,424+417 (+ 0.23%)~~p=0.001 n=6
Memory used461,841k (± 0.07%)461,724k (± 0.08%)~461,434k462,216kp=0.810 n=6
Parse Time2.63s (± 0.56%)2.62s (± 0.51%)~2.60s2.64sp=0.560 n=6
Bind Time0.99s (± 0.41%)0.99s (± 0.41%)~0.98s0.99sp=0.218 n=6
Check Time15.28s (± 0.32%)15.21s (± 0.63%)~15.10s15.38sp=0.092 n=6
Emit Time0.00s0.00s~~~p=1.000 n=6
Total Time18.90s (± 0.23%)18.81s (± 0.44%)~18.71s18.96sp=0.064 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)
BenchmarkNameIterations
Currentpr6
Baselinebaseline6

tsserver

Comparison Report - baseline..pr
MetricbaselineprDeltaBestWorstp-value
Compiler-UnionsTSServer - node (v18.15.0, x64)
Req 1 - updateOpen3,180ms (±10.73%)3,410ms (± 0.25%)~3,395ms3,419msp=0.093 n=6
Req 2 - geterr6,737ms (±11.21%)7,471ms (± 0.34%)🔻+734ms (+10.89%)7,443ms7,502msp=0.031 n=6
Req 3 - references397ms (± 0.58%)396ms (± 0.47%)~393ms398msp=0.516 n=6
Req 4 - navto338ms (± 0.55%)338ms (± 0.57%)~334ms339msp=0.729 n=6
Req 5 - completionInfo count1,3571,357~~~p=1.000 n=6
Req 5 - completionInfo128ms (± 5.51%)128ms (± 3.06%)~121ms132msp=0.743 n=6
CompilerTSServer - node (v18.15.0, x64)
Req 1 - updateOpen2,414ms (± 1.38%)2,402ms (± 0.67%)~2,382ms2,423msp=0.936 n=6
Req 2 - geterr3,807ms (± 0.14%)3,807ms (± 0.27%)~3,792ms3,818msp=0.687 n=6
Req 3 - references277ms (± 0.58%)276ms (± 0.19%)~276ms277msp=0.418 n=6
Req 4 - navto227ms (± 0.18%)227ms~~~p=0.405 n=6
Req 5 - completionInfo count1,5191,519~~~p=1.000 n=6
Req 5 - completionInfo77ms (± 8.12%)73ms (± 2.93%)~69ms75msp=0.459 n=6
xstate-main-1-tsserver - node (v18.15.0, x64)
Req 1 - updateOpen5,144ms (± 0.49%)5,144ms (± 0.44%)~5,118ms5,182msp=1.000 n=6
Req 2 - geterr1,134ms (± 0.99%)1,141ms (± 1.36%)~1,120ms1,164msp=0.470 n=6
Req 3 - references80ms (± 4.60%)79ms (± 5.01%)~75ms84msp=0.740 n=6
Req 4 - navto454ms (± 0.72%)453ms (± 0.55%)~449ms456msp=0.570 n=6
Req 5 - completionInfo count3,4133,413~~~p=1.000 n=6
Req 5 - completionInfo842ms (± 2.31%)832ms (± 0.80%)~824ms842msp=0.467 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)
BenchmarkNameIterations
Currentpr6
Baselinebaseline6

startup

Comparison Report - baseline..pr
MetricbaselineprDeltaBestWorstp-value
tsc-startup - node (v18.15.0, x64)
Execution time157.42ms (± 0.17%)157.44ms (± 0.18%)~156.43ms160.97msp=0.819 n=600
tsserver-startup - node (v18.15.0, x64)
Execution time241.14ms (± 0.12%)241.27ms (± 0.15%)+0.13ms (+ 0.06%)239.70ms247.87msp=0.001 n=600
tsserverlibrary-startup - node (v18.15.0, x64)
Execution time236.11ms (± 0.15%)236.25ms (± 0.14%)+0.14ms (+ 0.06%)235.00ms243.05msp=0.000 n=600
typescript-startup - node (v18.15.0, x64)
Execution time236.69ms (± 0.15%)236.69ms (± 0.16%)~235.25ms243.14msp=0.998 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)
BenchmarkNameIterations
Currentpr6
Baselinebaseline6

Developer Information:

Download Benchmarks

@typescript-bot

Copy link
Copy Markdown
Contributor

Jake Bailey (@jakebailey) Here are the results of running the top 800 repos with tsc comparing main and refs/pull/54183/merge:

Everything looks good!

@TkDodo

Copy link
Copy Markdown

Jake Bailey (@jakebailey) would it be possible to get a PR preview build with the changes from here? We think there might be an issue in react-query that’s related to this and I’d like to check if this PR fixes it:

🙏

@Andarist
Mateusz Burzyński (Andarist)force-pushed the fix/intra-expression-inference-with-resolved-calls branch from a9c578f to 32740a4CompareMay 12, 2025 14:25
@jakebailey

Copy link
Copy Markdown
Member

TypeScript Bot (@typescript-bot) pack this

@typescript-bot

TypeScript Bot (typescript-bot) commented May 19, 2025

Copy link
Copy Markdown
Contributor

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

CommandStatusResults
pack this✅ Started✅ Results

@typescript-bot

TypeScript Bot (typescript-bot) commented May 19, 2025

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/165139/artifacts?artifactName=tgz&fileId=A35EB8A1813601B5F71AACABEF6E9C260578FA5D0A893F40322DE21F7C3C8F4402&fileName=/typescript-5.9.0-insiders.20250519.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.9.0-pr-54183-44".;

@TkDodo

Copy link
Copy Markdown

Thank you Jake Bailey (@jakebailey) ❤️ . Mateusz Burzyński (@Andarist)just confirmed that this PR fixes the issue, which is great news 🎉

CopilotAI review requested due to automatic review settings August 4, 2025 08:21

CopilotAI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull Request Overview

This PR improves TypeScript's type inference for nested generic function calls by expanding the conditions under which expressions are considered as potential intra-expression inference sites. The change addresses a bug where nested generic functions were being skipped during the first pass of type inference, leading to incomplete type resolution.

Key changes:

  • Renames isContextSensitive to containsContextSensitive for better clarity of purpose
  • Introduces containsContextSensitiveOrCallOrNewExpression to include call and new expressions as inference sites
  • Updates inference site detection to consider nested calls and constructors alongside context-sensitive functions

Reviewed Changes

Copilot reviewed 14 out of 14 changed files in this pull request and generated no comments.

Show a summary per file
FileDescription
src/compiler/checker.tsCore logic changes to expand inference site detection and rename context sensitivity checking function
src/compiler/types.tsUpdates type interface to reflect function rename
src/services/refactors/extractSymbol.tsUpdates function call to use renamed containsContextSensitive
tests/cases/conformance/types/typeRelationships/typeInference/intraExpressionInferencesNestedGenericCall1.tsComprehensive test case for nested generic call inference with complex Fastify-style type provider pattern
tests/cases/conformance/types/typeRelationships/typeInference/intraExpressionInferencesJsx.tsxAdditional JSX test case demonstrating improved inference
tests/cases/conformance/types/typeRelationships/typeInference/intraExpressionInferences.tsExtended test cases for both object and tuple parameter patterns
Various baseline filesExpected test outputs showing improved type inference results
Comments suppressed due to low confidence (2)

@github-project-automationgithub-project-automationBot moved this from Waiting on reviewers to Done in PR BacklogMar 24, 2026
@typescript-bot

Copy link
Copy Markdown
Contributor

With 6.0 out as the final release vehicle for this codebase, we're closing all PRs that don't fit the merge criteria for post-6.0 patches. If you think this was a mistake and this PR fits the post-6.0 patch criteria, please post to the 6.0 iteration issue with details (specifically, which PR and which patch criteria it satisfies).

Next steps for PRs:

  • For crash bugfixes or language service improvements, PRs are currently accepted at the typescript-go repo
  • Changes to type system behavior should wait until after 7.0, at which point mainline TypeScript development will resume in this repository with the Go codebase
  • Library file updates (lib.d.ts etc) continue to live in this repo or the DOM Generator repo as appropriate

Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

For Backlog BugPRs that fix a backlog bug

Projects

Status: Done

10 participants

@Andarist@typescript-bot@weswigham@DanielRosenwasser@jakebailey@TkDodo@sandersn@ahejlsberg@RyanCavanaugh