Skip to content

Cache inferences made from type arguments - #64553

Merged
Anders Hejlsberg (ahejlsberg) merged 3 commits into
mainfrom
fix-64378
Sep 30, 2026
Merged

Anders Hejlsberg (ahejlsberg) merged 3 commits into
mainfrom
fix-64378

Conversation

@ahejlsberg

Copy link
Copy Markdown
Member

With this PR we cache inferences made from type arguments of references to the same alias or class/interface. The PR supersedes #64388 which implements similar caching, but does so through a separate cache instead of leveraging the existing invokeOnce caching infrastructure.

The PR fixes an issue with the existing cache where priority, contravariant, and bivariant states weren't included in the cache key. This would cause false matches and lead to dropped inferences. This fix revealed a test case in correlatedUnions.ts that incorrectly depended on dropped inferences and now requires use of NoInfer<T>. The issue can be observed by the error in this version of the test that simply reverses the declaration order of letter and caller in the LetterCaller type.

Thanks Oleksandr Tarasiuk (@a-tarasyuk) for researching the root cause and fix for the issue in #64378.

Fixes #64378.

Copilot AI balanced review requested due to automatic review settings September 30, 2026 15:29
@github-project-automation github-project-automation Bot moved this to Not started in PR Backlog Sep 30, 2026
@typescript-automation typescript-automation Bot added Author: Team For Uncommitted Bug PR for untriaged, rejected, closed or missing bug labels Sep 30, 2026

Copilot AI 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.

Copilot review overview

🟡 Changes recommended

The cache key omits propagation state, and the performance regression lacks direct test coverage.

Review effort: Balanced
Findings: 1 High severity · 1 Low severity

Open (2)
What changed in this PR

Caches type-argument inference for matching aliases and generic references to prevent exponential checking.

Changes:

  • Extends inference cache keys with variance and priority state.
  • Routes alias/reference inference through invokeOnce.
  • Updates correlated-union tests for corrected inference behavior.
File Description
tsc/​internal/​checker/​inference.go Implements expanded inference caching.
tsc/​testdata/​tests/​cases/​compiler/​correlatedUnions.ts Uses NoInfer to preserve intended inference.
tsc/​testdata/​baselines/​reference/​compiler/​correlatedUnions.types Updates type baseline.
tsc/​testdata/​baselines/​reference/​compiler/​correlatedUnions.symbols Updates symbol baseline.
tsc/​testdata/​baselines/​reference/​compiler/​correlatedUnions.js Updates emit baseline.

// between the same pair of types.
func (c *Checker) invokeOnce(n *InferenceState, source *Type, target *Type, action func(c *Checker, n *InferenceState, source *Type, target *Type)) {
key := InferenceKey{s: source.id, t: target.id}
key := InferenceKey{source: source.id, target: target.id, priority: n.priority, contravariant: n.contravariant, bivariant: n.bivariant}
case source.objectFlags&ObjectFlagsReference != 0 && target.objectFlags&ObjectFlagsReference != 0 && (source.AsTypeReference().target == target.AsTypeReference().target || c.isArrayType(source) && c.isArrayType(target)) && !(source.AsTypeReference().node != nil && target.AsTypeReference().node != nil):
// If source and target are references to the same generic type, infer from type arguments
c.inferFromTypeArguments(n, c.getTypeArguments(source), c.getTypeArguments(target), c.getVariances(source.AsTypeReference().target))
c.invokeOnce(n, source, target, (*Checker).inferFromReferenceTypeArguments)
@ahejlsberg

Copy link
Copy Markdown
Member Author

Oleksandr Tarasiuk (@a-tarasyuk) I have manually verified that this has the same effect on check times for the original repro and the test you included in #64388. Can you describe what goes on in that test? I'd like to understand before we include it.

@ahejlsberg

Copy link
Copy Markdown
Member Author

TypeScript Bot (@typescript-bot) test it

@typescript-automation

typescript-automation Bot commented Sep 30, 2026 •

Copy link
Copy Markdown
Contributor

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

Command Status Results
test top400 ✅ Started ✅ Results
user test this ✅ Started 👀 Results
run dt ✅ Started ✅ Results
perf test this faster ✅ Started ❌ Results

@typescript-automation

Copy link
Copy Markdown
Contributor

Anders Hejlsberg (@ahejlsberg), the perf run you requested failed. You can check the log here.

@typescript-automation

Copy link
Copy Markdown
Contributor

Hey Anders Hejlsberg (@ahejlsberg), the results of running the DT tests are ready.

Everything looks the same!

You can check the log here.

@typescript-automation

Copy link
Copy Markdown
Contributor

Anders Hejlsberg (@ahejlsberg) Here are the results of running the user tests with tsc comparing main and refs/pull/64553/merge:

Something interesting changed - please have a look.

Details

webpack

tsconfig.json

  • [NEW] error TS2322: Type 'HookMap<SyncBailHook<ParserOptions | [EmptyParserOptions], HtmlParser, UnsetAdditionalOptions>>' is not assignable to type 'TypedHookMap<Record<JAVASCRIPT_MODULE_TYPE_AUTO, SyncBailHook<[JavascriptParserOptions], JavascriptParser, UnsetAdditionalOptions>> & ... 15 more ... & Record<...>>'.
  • [NEW] error TS2322: Type 'HookMap<SyncHook<[JavascriptParser, JavascriptParserOptions] | [Parser, ParserOptions], void, UnsetAdditionalOptions>>' is not assignable to type 'TypedHookMap<Record<JAVASCRIPT_MODULE_TYPE_AUTO, SyncBailHook<[JavascriptParser, JavascriptParserOptions], void, UnsetAdditionalOptions>> & ... 15 more ... & Record<...>>'.
  • [NEW] error TS2322: Type 'HookMap<SyncBailHook<GeneratorOptions | [GeneratorOptions] | [HtmlGeneratorOptions], HtmlGenerator, UnsetAdditionalOptions>>' is not assignable to type 'TypedHookMap<Record<JAVASCRIPT_MODULE_TYPE_AUTO, SyncBailHook<[EmptyGeneratorOptions], JavascriptGenerator, UnsetAdditionalOptions>> & ... 15 more ... & Record<...>>'.
  • [NEW] error TS2322: Type 'HookMap<SyncHook<[Generator, GeneratorOptions] | [JavascriptGenerator, EmptyGeneratorOptions], void, UnsetAdditionalOptions>>' is not assignable to type 'TypedHookMap<Record<JAVASCRIPT_MODULE_TYPE_AUTO, SyncBailHook<[JavascriptGenerator, EmptyGeneratorOptions], void, UnsetAdditionalOptions>> & ... 15 more ... & Record<...>>'.
  • [MISSING] error TS2322: Type 'HookMap<SyncBailHook<[EmptyParserOptions], HtmlParser, UnsetAdditionalOptions>>' is not assignable to type 'TypedHookMap<Record<JAVASCRIPT_MODULE_TYPE_AUTO, SyncBailHook<[JavascriptParserOptions], JavascriptParser, UnsetAdditionalOptions>> & ... 15 more ... & Record<...>>'.
  • [MISSING] error TS2322: Type 'HookMap<SyncHook<[JavascriptParser, JavascriptParserOptions], void, UnsetAdditionalOptions>>' is not assignable to type 'TypedHookMap<Record<JAVASCRIPT_MODULE_TYPE_AUTO, SyncBailHook<[JavascriptParser, JavascriptParserOptions], void, UnsetAdditionalOptions>> & ... 15 more ... & Record<...>>'.
  • [MISSING] error TS2322: Type 'HookMap<SyncBailHook<[HtmlGeneratorOptions], HtmlGenerator, UnsetAdditionalOptions>>' is not assignable to type 'TypedHookMap<Record<JAVASCRIPT_MODULE_TYPE_AUTO, SyncBailHook<[EmptyGeneratorOptions], JavascriptGenerator, UnsetAdditionalOptions>> & ... 15 more ... & Record<...>>'.
  • [MISSING] error TS2322: Type 'HookMap<SyncHook<[JavascriptGenerator, EmptyGeneratorOptions], void, UnsetAdditionalOptions>>' is not assignable to type 'TypedHookMap<Record<JAVASCRIPT_MODULE_TYPE_AUTO, SyncBailHook<[JavascriptGenerator, EmptyGeneratorOptions], void, UnsetAdditionalOptions>> & ... 15 more ... & Record<...>>'.

tsconfig.types.json

  • [NEW] error TS2322: Type 'HookMap<SyncBailHook<ParserOptions | [EmptyParserOptions], HtmlParser, UnsetAdditionalOptions>>' is not assignable to type 'TypedHookMap<Record<JAVASCRIPT_MODULE_TYPE_AUTO, SyncBailHook<[JavascriptParserOptions], JavascriptParser, UnsetAdditionalOptions>> & ... 15 more ... & Record<...>>'.
  • [NEW] error TS2322: Type 'HookMap<SyncHook<[JavascriptParser, JavascriptParserOptions] | [Parser, ParserOptions], void, UnsetAdditionalOptions>>' is not assignable to type 'TypedHookMap<Record<JAVASCRIPT_MODULE_TYPE_AUTO, SyncBailHook<[JavascriptParser, JavascriptParserOptions], void, UnsetAdditionalOptions>> & ... 15 more ... & Record<...>>'.
  • [NEW] error TS2322: Type 'HookMap<SyncBailHook<GeneratorOptions | [GeneratorOptions] | [HtmlGeneratorOptions], HtmlGenerator, UnsetAdditionalOptions>>' is not assignable to type 'TypedHookMap<Record<JAVASCRIPT_MODULE_TYPE_AUTO, SyncBailHook<[EmptyGeneratorOptions], JavascriptGenerator, UnsetAdditionalOptions>> & ... 15 more ... & Record<...>>'.
  • [NEW] error TS2322: Type 'HookMap<SyncHook<[Generator, GeneratorOptions] | [JavascriptGenerator, EmptyGeneratorOptions], void, UnsetAdditionalOptions>>' is not assignable to type 'TypedHookMap<Record<JAVASCRIPT_MODULE_TYPE_AUTO, SyncBailHook<[JavascriptGenerator, EmptyGeneratorOptions], void, UnsetAdditionalOptions>> & ... 15 more ... & Record<...>>'.
  • [MISSING] error TS2322: Type 'HookMap<SyncBailHook<[EmptyParserOptions], HtmlParser, UnsetAdditionalOptions>>' is not assignable to type 'TypedHookMap<Record<JAVASCRIPT_MODULE_TYPE_AUTO, SyncBailHook<[JavascriptParserOptions], JavascriptParser, UnsetAdditionalOptions>> & ... 15 more ... & Record<...>>'.
  • [MISSING] error TS2322: Type 'HookMap<SyncHook<[JavascriptParser, JavascriptParserOptions], void, UnsetAdditionalOptions>>' is not assignable to type 'TypedHookMap<Record<JAVASCRIPT_MODULE_TYPE_AUTO, SyncBailHook<[JavascriptParser, JavascriptParserOptions], void, UnsetAdditionalOptions>> & ... 15 more ... & Record<...>>'.
  • [MISSING] error TS2322: Type 'HookMap<SyncBailHook<[HtmlGeneratorOptions], HtmlGenerator, UnsetAdditionalOptions>>' is not assignable to type 'TypedHookMap<Record<JAVASCRIPT_MODULE_TYPE_AUTO, SyncBailHook<[EmptyGeneratorOptions], JavascriptGenerator, UnsetAdditionalOptions>> & ... 15 more ... & Record<...>>'.
  • [MISSING] error TS2322: Type 'HookMap<SyncHook<[JavascriptGenerator, EmptyGeneratorOptions], void, UnsetAdditionalOptions>>' is not assignable to type 'TypedHookMap<Record<JAVASCRIPT_MODULE_TYPE_AUTO, SyncBailHook<[JavascriptGenerator, EmptyGeneratorOptions], void, UnsetAdditionalOptions>> & ... 15 more ... & Record<...>>'.

tsconfig.types.test.json

  • [NEW] error TS2322: Type 'HookMap<SyncBailHook<ParserOptions | [EmptyParserOptions], HtmlParser, UnsetAdditionalOptions>>' is not assignable to type 'TypedHookMap<Record<JAVASCRIPT_MODULE_TYPE_AUTO, SyncBailHook<[JavascriptParserOptions], JavascriptParser, UnsetAdditionalOptions>> & ... 15 more ... & Record<...>>'.
  • [NEW] error TS2322: Type 'HookMap<SyncHook<[JavascriptParser, JavascriptParserOptions] | [Parser, ParserOptions], void, UnsetAdditionalOptions>>' is not assignable to type 'TypedHookMap<Record<JAVASCRIPT_MODULE_TYPE_AUTO, SyncBailHook<[JavascriptParser, JavascriptParserOptions], void, UnsetAdditionalOptions>> & ... 15 more ... & Record<...>>'.
  • [NEW] error TS2322: Type 'HookMap<SyncBailHook<GeneratorOptions | [GeneratorOptions] | [HtmlGeneratorOptions], HtmlGenerator, UnsetAdditionalOptions>>' is not assignable to type 'TypedHookMap<Record<JAVASCRIPT_MODULE_TYPE_AUTO, SyncBailHook<[EmptyGeneratorOptions], JavascriptGenerator, UnsetAdditionalOptions>> & ... 15 more ... & Record<...>>'.
  • [NEW] error TS2322: Type 'HookMap<SyncHook<[Generator, GeneratorOptions] | [JavascriptGenerator, EmptyGeneratorOptions], void, UnsetAdditionalOptions>>' is not assignable to type 'TypedHookMap<Record<JAVASCRIPT_MODULE_TYPE_AUTO, SyncBailHook<[JavascriptGenerator, EmptyGeneratorOptions], void, UnsetAdditionalOptions>> & ... 15 more ... & Record<...>>'.
  • [MISSING] error TS2322: Type 'HookMap<SyncBailHook<[EmptyParserOptions], HtmlParser, UnsetAdditionalOptions>>' is not assignable to type 'TypedHookMap<Record<JAVASCRIPT_MODULE_TYPE_AUTO, SyncBailHook<[JavascriptParserOptions], JavascriptParser, UnsetAdditionalOptions>> & ... 15 more ... & Record<...>>'.
  • [MISSING] error TS2322: Type 'HookMap<SyncHook<[JavascriptParser, JavascriptParserOptions], void, UnsetAdditionalOptions>>' is not assignable to type 'TypedHookMap<Record<JAVASCRIPT_MODULE_TYPE_AUTO, SyncBailHook<[JavascriptParser, JavascriptParserOptions], void, UnsetAdditionalOptions>> & ... 15 more ... & Record<...>>'.
  • [MISSING] error TS2322: Type 'HookMap<SyncBailHook<[HtmlGeneratorOptions], HtmlGenerator, UnsetAdditionalOptions>>' is not assignable to type 'TypedHookMap<Record<JAVASCRIPT_MODULE_TYPE_AUTO, SyncBailHook<[EmptyGeneratorOptions], JavascriptGenerator, UnsetAdditionalOptions>> & ... 15 more ... & Record<...>>'.
  • [MISSING] error TS2322: Type 'HookMap<SyncHook<[JavascriptGenerator, EmptyGeneratorOptions], void, UnsetAdditionalOptions>>' is not assignable to type 'TypedHookMap<Record<JAVASCRIPT_MODULE_TYPE_AUTO, SyncBailHook<[JavascriptGenerator, EmptyGeneratorOptions], void, UnsetAdditionalOptions>> & ... 15 more ... & Record<...>>'.

@typescript-automation

Copy link
Copy Markdown
Contributor

Anders Hejlsberg (@ahejlsberg) Here are the results of running the top 400 repos with tsc comparing main and refs/pull/64553/merge:

Everything looks good!

@ahejlsberg

Copy link
Copy Markdown
Member Author

TypeScript Bot (@typescript-bot) perf test this faster

@typescript-automation

typescript-automation Bot commented Sep 30, 2026 •

Copy link
Copy Markdown
Contributor

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

Command Status Results
perf test this faster ✅ Started 👀 Results

@ahejlsberg

Copy link
Copy Markdown
Member Author

The change in the webpack user test is simply that we're inferring a different type now that there aren't dropped inferences. The errors themselves are actually follow-on errors from other issues in webpack (specifically here that use of values as types now require explicit typeof operators, a documented requirement in 7.0).

@typescript-automation typescript-automation Bot added For Backlog Bug PRs that fix a backlog bug and removed For Uncommitted Bug PR for untriaged, rejected, closed or missing bug labels Sep 30, 2026
@typescript-automation

Copy link
Copy Markdown
Contributor

Anders Hejlsberg (@ahejlsberg)
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 - native
Errors 41 41 ~ ~ ~ p=1.000 n=12
Symbols 115,276 115,276 ~ ~ ~ p=1.000 n=12
Types 79,613 79,613 ~ ~ ~ p=1.000 n=12
Memory Used 141,556k (± 0.49%) 141,338k (± 0.52%) ~ 139,859k 143,827k p=0.443 n=12
Memory Allocs 2,194,586 (± 0.00%) 2,194,599 (± 0.00%) ~ 2,194,380 2,194,909 p=1.000 n=12
Config Time 0.000s 0.000s ~ ~ ~ p=1.000 n=12
Parse Time 0.042s (± 5.89%) 0.041s (± 3.16%) ~ 0.038s 0.045s p=0.830 n=12
Bind Time 0.013s (±10.66%) 0.012s (± 9.82%) ~ 0.010s 0.015s p=0.134 n=12
Check Time 0.495s (± 0.66%) 0.501s (± 0.95%) ~ 0.489s 0.513s p=0.061 n=12
Emit Time 0.262s (± 2.05%) 0.265s (± 1.63%) ~ 0.254s 0.280s p=0.522 n=12
Total Time 0.818s (± 0.86%) 0.825s (± 0.72%) ~ 0.810s 0.837s p=0.259 n=12
angular-1 - native
Errors 3 3 ~ ~ ~ p=1.000 n=12
Symbols 846,355 (± 0.08%) 846,129 (± 0.07%) ~ 844,690 847,828 p=0.524 n=12
Types 249,938 (± 0.00%) 249,938 (± 0.00%) ~ 249,937 249,940 p=0.552 n=12
Memory Used 789,025k (± 0.06%) 789,395k (± 0.08%) ~ 788,262k 791,445k p=0.410 n=12
Memory Allocs 12,937,546 (± 0.06%) 12,940,170 (± 0.06%) ~ 12,931,224 12,969,110 p=0.319 n=12
Config Time 0.016s 0.016s ~ ~ ~ p=1.000 n=12
Parse Time 0.266s (± 3.16%) 0.263s (± 3.19%) ~ 0.245s 0.284s p=0.745 n=12
Bind Time 0.068s (±18.09%) 0.074s (±18.25%) ~ 0.057s 0.118s p=0.375 n=12
Check Time 0s 0s ~ ~ ~ p=1.000 n=12
Emit Time 1.620s (± 1.54%) 1.633s (± 1.47%) ~ 1.576s 1.687s p=0.560 n=12
Total Time 1.988s (± 1.60%) 2.009s (± 1.51%) ~ 1.935s 2.069s p=0.291 n=12
mui-docs - native
Errors 11,394 (± 0.05%) 11,402 (± 0.02%) +8 (+ 0.07%) 11,394 11,405 p=0.016 n=12
Symbols 4,450,780 4,450,780 ~ ~ ~ p=1.000 n=12
Types 1,441,847 1,441,847 ~ ~ ~ p=1.000 n=12
Memory Used 3,191,941k (± 0.05%) 3,191,048k (± 0.04%) ~ 3,186,188k 3,195,056k p=0.347 n=12
Memory Allocs 34,632,033 (± 0.04%) 34,633,312 (± 0.07%) ~ 34,575,257 34,724,216 p=0.551 n=12
Config Time 0.016s (± 1.55%) 0.015s (± 2.10%) ~ 0.015s 0.016s p=0.089 n=12
Parse Time 0.586s (± 2.17%) 0.581s (± 2.51%) ~ 0.538s 0.614s p=0.561 n=12
Bind Time 0.002s 0.002s ~ ~ ~ p=1.000 n=12
Check Time 8.643s (± 1.14%) 8.677s (± 1.09%) ~ 8.519s 8.939s p=0.671 n=12
Emit Time 0.603s (±13.77%) 0.568s (±15.94%) ~ 0.427s 0.723s p=0.310 n=12
Total Time 10.620s (± 0.42%) 10.620s (± 0.37%) ~ 10.533s 10.724s p=0.887 n=12
strada-build-src - native
Errors 0 0 ~ ~ ~ p=1.000 n=12
Symbols 1,390,229 1,390,229 ~ ~ ~ p=1.000 n=12
Types 441,498 441,498 ~ ~ ~ p=1.000 n=12
Memory Used 1,676,048k (± 0.92%) 1,681,624k (± 0.97%) ~ 1,647,577k 1,718,421k p=0.378 n=12
Memory Allocs 92,591,098 (± 0.15%) 92,637,206 (± 0.17%) ~ 92,171,612 93,031,252 p=0.755 n=12
Config Time 0.004s (±16.42%) 0.004s (±14.19%) ~ 0.003s 0.007s p=0.411 n=12
Parse Time 0.207s (± 4.85%) 0.210s (± 4.81%) ~ 0.189s 0.237s p=0.681 n=12
Bind Time 0.000s 0.000s ~ ~ ~ p=1.000 n=12
Check Time 1.816s (± 0.63%) 1.817s (± 0.60%) ~ 1.785s 1.840s p=0.702 n=12
Emit Time 0.298s (± 4.36%) 0.313s (± 5.99%) ~ 0.253s 0.356s p=0.097 n=12
Total Time 23.490s (± 0.70%) 23.602s (± 0.67%) ~ 23.182s 23.943s p=0.198 n=12
strada-compiler - native
Errors 0 0 ~ ~ ~ p=1.000 n=12
Symbols 334,953 334,953 ~ ~ ~ p=1.000 n=12
Types 197,616 197,616 ~ ~ ~ p=1.000 n=12
Memory Used 313,333k (± 0.03%) 313,325k (± 0.04%) ~ 312,741k 313,500k p=0.702 n=12
Memory Allocs 4,628,364 (± 0.01%) 4,628,254 (± 0.01%) ~ 4,627,164 4,629,018 p=0.671 n=12
Config Time 0.001s 0.001s ~ ~ ~ p=1.000 n=12
Parse Time 0.111s (± 4.89%) 0.114s (± 4.29%) ~ 0.098s 0.124s p=0.223 n=12
Bind Time 0.000s 0.000s ~ ~ ~ p=1.000 n=12
Check Time 1.049s (± 0.41%) 1.054s (± 0.71%) ~ 1.041s 1.088s p=0.310 n=12
Emit Time 0.131s (±11.75%) 0.125s (±12.38%) ~ 0.094s 0.167s p=0.619 n=12
Total Time 1.342s (± 1.02%) 1.344s (± 1.13%) ~ 1.310s 1.393s p=0.990 n=12
ts-pre-modules - native
Errors 87 87 ~ ~ ~ p=1.000 n=12
Symbols 303,834 303,834 ~ ~ ~ p=1.000 n=12
Types 181,663 181,663 ~ ~ ~ p=1.000 n=12
Memory Used 273,944k (± 0.02%) 273,938k (± 0.01%) ~ 273,832k 274,008k p=0.799 n=12
Memory Allocs 1,618,109 (± 0.01%) 1,618,072 (± 0.02%) ~ 1,617,479 1,619,311 p=0.478 n=12
Config Time 0.000s (±113.79%) 0.000s (±146.91%) ~ 0.000s 0.001s p=1.000 n=12
Parse Time 0.095s (± 3.99%) 0.100s (± 3.66%) 🔻+0.005s (+ 5.45%) 0.092s 0.115s p=0.041 n=12
Bind Time 0.040s (±10.27%) 0.036s (± 8.62%) ~ 0.031s 0.046s p=0.070 n=12
Check Time 0.825s (± 0.70%) 0.823s (± 0.50%) ~ 0.809s 0.833s p=0.876 n=12
Emit Time 0.000s 0.000s ~ ~ ~ p=1.000 n=12
Total Time 0.974s (± 0.61%) 0.973s (± 0.77%) ~ 0.960s 0.999s p=0.541 n=12
vscode - native
Errors 382 382 ~ ~ ~ p=1.000 n=12
Symbols 10,126,408 10,126,407 -1 (- 0.00%) ~ ~ p=0.000 n=12
Types 3,393,264 3,393,264 ~ ~ ~ p=1.000 n=12
Memory Used 6,597,722k (± 0.02%) 6,595,118k (± 0.01%) -2,604k (- 0.04%) 6,592,767k 6,597,688k p=0.000 n=12
Memory Allocs 50,759,158 (± 0.01%) 50,757,343 (± 0.01%) ~ 50,750,575 50,772,215 p=0.443 n=12
Config Time 0.067s (± 0.42%) 0.067s (± 0.42%) ~ 0.067s 0.068s p=1.000 n=12
Parse Time 1.883s (± 3.54%) 1.863s (± 3.08%) ~ 1.755s 2.004s p=0.579 n=12
Bind Time 0.478s (±19.49%) 0.475s (±14.86%) ~ 0.409s 0.715s p=0.787 n=12
Check Time 14.258s (± 0.93%) 14.314s (± 1.05%) ~ 13.889s 14.529s p=0.066 n=12
Emit Time 4.032s (± 8.58%) 4.413s (±12.19%) 🔻+0.380s (+ 9.43%) 3.786s 5.798s p=0.037 n=12
Total Time 20.825s (± 1.36%) 21.242s (± 2.04%) +0.417s (+ 2.00%) 20.620s 22.354s p=0.024 n=12
webpack - native
Errors 581 581 ~ ~ ~ p=1.000 n=12
Symbols 1,274,916 1,275,494 +578 (+ 0.05%) ~ ~ p=0.000 n=12
Types 595,481 597,272 +1,791 (+ 0.30%) ~ ~ p=0.000 n=12
Memory Used 972,424k (± 0.02%) 973,663k (± 0.02%) +1,239k (+ 0.13%) 973,291k 974,219k p=0.000 n=12
Memory Allocs 6,276,672 (± 0.01%) 6,294,435 (± 0.02%) +17,763 (+ 0.28%) 6,291,950 6,297,357 p=0.000 n=12
Config Time 0.009s 0.009s ~ ~ ~ p=1.000 n=12
Parse Time 0.285s (± 3.28%) 0.286s (± 2.34%) ~ 0.268s 0.302s p=0.989 n=12
Bind Time 0.079s (±18.46%) 0.073s (±13.20%) ~ 0.060s 0.107s p=0.658 n=12
Check Time 1.824s (± 0.71%) 1.824s (± 0.68%) ~ 1.796s 1.855s p=0.831 n=12
Emit Time 0.000s 0.000s ~ ~ ~ p=1.000 n=12
Total Time 2.233s (± 0.70%) 2.229s (± 0.44%) ~ 2.208s 2.251s p=0.989 n=12
xstate-main - native
Errors 0 0 ~ ~ ~ p=1.000 n=12
Symbols 1,030,692 1,030,684 -8 (- 0.00%) ~ ~ p=0.000 n=12
Types 376,396 376,386 -10 (- 0.00%) ~ ~ p=0.000 n=12
Memory Used 598,484k (± 0.02%) 598,468k (± 0.01%) ~ 598,273k 598,728k p=0.671 n=12
Memory Allocs 4,762,199 (± 0.05%) 4,760,558 (± 0.04%) ~ 4,756,840 4,767,104 p=0.410 n=12
Config Time 0.003s (±11.61%) 0.003s (±13.14%) ~ 0.002s 0.003s p=0.680 n=12
Parse Time 0.146s (± 3.77%) 0.145s (± 3.23%) ~ 0.135s 0.159s p=0.639 n=12
Bind Time 0.046s (±19.56%) 0.048s (±13.98%) ~ 0.033s 0.067s p=0.638 n=12
Check Time 1.063s (± 0.48%) 1.072s (± 0.49%) +0.009s (+ 0.87%) 1.056s 1.082s p=0.009 n=12
Emit Time 0.000s 0.000s ~ ~ ~ p=1.000 n=12
Total Time 1.269s (± 0.64%) 1.279s (± 0.80%) ~ 1.252s 1.302s p=0.097 n=12
System info unknown
Hosts
  • native
Scenarios
  • Compiler-Unions - native
  • angular-1 - native
  • mui-docs - native
  • strada-build-src - native
  • strada-compiler - native
  • ts-pre-modules - native
  • vscode - native
  • webpack - native
  • xstate-main - native
Benchmark Name Iterations
Current pr 12
Baseline baseline 12

Developer Information:

Download Benchmarks

@ahejlsberg
Anders Hejlsberg (ahejlsberg) added this pull request to the merge queue Sep 30, 2026
Merged via the queue into main with commit c8e9b7d Sep 30, 2026
30 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Author: Team For Backlog Bug PRs that fix a backlog bug

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

Performance: exponential check time as a chain of generic calls grows (index signature in the inferred spec type)

3 participants