Skip to content

Fix type variable leaks and cache inconsistencies #61668

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

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

Conversation

ahejlsberg
Copy link
Member

@ahejlsberg ahejlsberg commented May 7, 2025

This PR fixes two issues leading to type variable leaks and cache inconsistencies.

The first issue, reported in #59937, relates to instantiations of single-signature types with inferred type parameters sometimes leaking into other types because of omitted information in cache keys. The fix to this issue is to properly include the base type mapper when computing cache keys.

The second issue, reported in #61667, relates to circular inferences, i.e. situations where inferences reference type parameters for which the inferences are being made. This was reported fixed by #57403, but the situation still persists as demonstrated by #61667.

Our type inference infrastructure makes a core assumption that inferences aren't circular, and while #57403 manages to permit them in certain cases, it is unfortunately not a general solution. For that reason, this PR reverts #57403 and instead puts in place logic that ensures outer type parameters in contextual types are instantiated (possibly just to their constraints) before inferences are made to return types of inner function calls. Specifically, in this code

declare function call<A, R>(obj: { x: (a: A) => R }, arg: A): R
declare function wrap<X>(x: X): { x: X }
declare function id<T>(x: T): T;

const x = call(wrap(id), 1);  // Previously 'A', now 'unknown'

the result of wrap(id) has type { x: <T>(x: T) => T } and is contextually typed by { x: (a: A) => R }. Previously, we'd infer (x: A) => A as the type argument for X in the call to wrap, propagate that into the { x: (x: A) => A } result type, and then infer from that result type to { x: (a: A) => R }, producing the inference A for A. Which doesn't make sense (or at least would require a more sophisticated unification algorithm to reason about). With this PR, we ensure that the contextual type for the wrap(id) call is instantiated to be free of references to outer type parameters. This means that the contextual type is { x: (x: unknown) => unknown } and thus we make low priority inferences of unknown for A and R. We then subsequently make a better inference of 1 for A.

It would be nice if the example above would manage to propagate the inference of 1 for A all the way through to R, but we lack the machinery to do so (because we don't perform full unification). We are equipped to do it for "unwrapped" functions like <T>(x: T) => T, but not for generic functions nested in object types. It's simply a design limitation.

Because this PR reverts #57403, it is technically a breaking change. But it wasn't working right in the first place.

Fixes #59937.
Fixes #61667.

@Copilot Copilot AI review requested due to automatic review settings May 7, 2025 22:34
@github-project-automation github-project-automation bot moved this to Not started in PR Backlog May 7, 2025
@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.

Copy link

@Copilot Copilot AI left a comment

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 fixes two long‐standing issues—type variable leaks and cache inconsistencies—in our type inference system by properly incorporating the base type mapper into cache key computations and ensuring that outer type parameters in contextual types are instantiated before inference. In doing so, it reverts a previous change (#57403) and updates several tests and baseline outputs to reflect the correct, more conservative inference behavior.

  • Properly include the base type mapper when computing cache keys
  • Instantiate outer type parameters to avoid circular inferences during return type inference
  • Update test cases and baselines to match the new behavior

Reviewed Changes

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

File Description
tests/cases/compiler/*.ts New tests and example functions (e.g. withP3) to confirm that generic call inference behaves as expected.
tests/baselines/reference/* Baseline outputs have been updated (instantiation counts, inferred types, and symbols) to reflect the fixes.
src/compiler/types.ts Removed duplicate flag and deprecated interface definitions for SingleSignatureType to prevent leaks.
src/compiler/checker.ts Refactored signature instantiation logic (e.g. removal of unused helper functions, introduction of createOuterReturnMapper) to improve cache consistency and type inference accuracy.
Comments suppressed due to low confidence (2)

src/compiler/checker.ts:16310

  • [nitpick] Changing the parameter type from 'readonly Type[]' to 'Type[]' in getSignatureInstantiation improves mutability control and clarity; ensure that all relevant usages are consistent with this change.
function getSignatureInstantiation(signature: Signature, typeArguments: readonly Type[] | undefined, isJavascript: boolean, inferredTypeParameters?: readonly TypeParameter[]): Signature {

src/compiler/types.ts:6495

  • The duplication of the SingleSignatureType flag has been removed and defined only once. Verify that removing the previously stored 'outerTypeParameters' in SingleSignatureType does not affect dependent logic.
SingleSignatureType = 1 << 27, // A single signature type extracted from a potentially broader type

@ahejlsberg
Copy link
Member Author

@typescript-bot test it

@typescript-bot
Copy link
Collaborator

typescript-bot commented May 7, 2025

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-bot
Copy link
Collaborator

@ahejlsberg Here are the results of running the user tests with tsc comparing main and refs/pull/61668/merge:

Everything looks good!

@typescript-bot
Copy link
Collaborator

Hey @ahejlsberg, the results of running the DT tests are ready.

Everything looks the same!

You can check the log here.

@typescript-bot
Copy link
Collaborator

@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 - node (v18.15.0, x64)
Errors 34 34 ~ ~ ~ p=1.000 n=6
Symbols 62,390 62,444 +54 (+ 0.09%) ~ ~ p=0.001 n=6
Types 50,395 50,418 +23 (+ 0.05%) ~ ~ p=0.001 n=6
Memory used 195,407k (± 0.89%) 196,002k (± 0.73%) ~ 193,094k 196,681k p=0.230 n=6
Parse Time 1.61s (± 0.61%) 1.59s (± 2.34%) ~ 1.53s 1.64s p=0.368 n=6
Bind Time 0.88s (± 1.12%) 0.89s (± 1.84%) ~ 0.87s 0.91s p=0.402 n=6
Check Time 11.78s (± 0.44%) 11.76s (± 0.68%) ~ 11.69s 11.91s p=0.373 n=6
Emit Time 3.34s (± 3.53%) 3.34s (± 2.92%) ~ 3.25s 3.52s p=1.000 n=6
Total Time 17.61s (± 0.92%) 17.58s (± 0.74%) ~ 17.45s 17.79s p=0.748 n=6
angular-1 - node (v18.15.0, x64)
Errors 56 56 ~ ~ ~ p=1.000 n=6
Symbols 949,240 948,690 -550 (- 0.06%) ~ ~ p=0.001 n=6
Types 411,065 410,866 -199 (- 0.05%) ~ ~ p=0.001 n=6
Memory used 1,225,110k (± 0.00%) 1,224,520k (± 0.01%) -589k (- 0.05%) 1,224,469k 1,224,652k p=0.005 n=6
Parse Time 6.63s (± 0.72%) 6.65s (± 0.72%) ~ 6.55s 6.68s p=0.629 n=6
Bind Time 1.88s (± 0.27%) 1.89s (± 0.55%) ~ 1.87s 1.90s p=0.437 n=6
Check Time 31.96s (± 0.34%) 31.85s (± 0.56%) ~ 31.62s 32.13s p=0.229 n=6
Emit Time 15.18s (± 0.63%) 15.22s (± 0.43%) ~ 15.12s 15.31s p=0.423 n=6
Total Time 55.65s (± 0.15%) 55.60s (± 0.38%) ~ 55.30s 55.88s p=1.000 n=6
mui-docs - node (v18.15.0, x64)
Errors 0 0 ~ ~ ~ p=1.000 n=6
Symbols 2,439,929 2,437,696 -2,233 (- 0.09%) ~ ~ p=0.001 n=6
Types 872,556 872,504 -52 (- 0.01%) ~ ~ p=0.001 n=6
Memory used 2,448,492k (± 0.00%) 2,448,391k (± 0.00%) ~ 2,448,331k 2,448,454k p=0.066 n=6
Parse Time 10.54s (± 0.33%) 10.55s (± 0.16%) ~ 10.53s 10.57s p=0.373 n=6
Bind Time 2.68s (± 0.60%) 2.71s (± 1.22%) ~ 2.67s 2.75s p=0.145 n=6
Check Time 87.13s (± 1.38%) 87.56s (± 1.48%) ~ 86.27s 88.85s p=0.298 n=6
Emit Time 0.37s (± 2.81%) 0.37s (± 2.41%) ~ 0.36s 0.38s p=0.673 n=6
Total Time 100.72s (± 1.18%) 101.17s (± 1.30%) ~ 99.88s 102.53s p=0.336 n=6
self-build-src - node (v18.15.0, x64)
Errors 0 0 ~ ~ ~ p=1.000 n=6
Symbols 1,228,052 1,226,347 -1,705 (- 0.14%) ~ ~ p=0.001 n=6
Types 267,262 267,149 -113 (- 0.04%) ~ ~ p=0.001 n=6
Memory used 2,360,718k (± 0.03%) 2,359,965k (± 0.03%) ~ 2,359,396k 2,361,052k p=0.093 n=6
Parse Time 5.22s (± 1.28%) 5.22s (± 0.94%) ~ 5.16s 5.28s p=1.000 n=6
Bind Time 1.81s (± 0.46%) 1.80s (± 0.96%) ~ 1.77s 1.82s p=0.503 n=6
Check Time 35.30s (± 0.19%) 34.95s (± 0.26%) -0.35s (- 0.99%) 34.81s 35.04s p=0.005 n=6
Emit Time 2.99s (± 0.81%) 2.97s (± 0.87%) ~ 2.95s 3.01s p=0.517 n=6
Total Time 45.30s (± 0.13%) 44.94s (± 0.21%) -0.36s (- 0.80%) 44.83s 45.11s p=0.005 n=6
self-build-src-public-api - node (v18.15.0, x64)
Errors 0 0 ~ ~ ~ p=1.000 n=6
Symbols 1,228,052 1,226,347 -1,705 (- 0.14%) ~ ~ p=0.001 n=6
Types 267,262 267,149 -113 (- 0.04%) ~ ~ p=0.001 n=6
Memory used 2,794,398k (±14.25%) 3,035,731k (± 9.78%) ~ 2,428,884k 3,157,660k p=0.936 n=6
Parse Time 6.87s (± 1.71%) 6.90s (± 1.05%) ~ 6.78s 6.98s p=0.575 n=6
Bind Time 2.16s (± 1.05%) 2.18s (± 1.80%) ~ 2.12s 2.22s p=0.421 n=6
Check Time 42.90s (± 0.71%) 42.69s (± 0.34%) ~ 42.43s 42.81s p=0.378 n=6
Emit Time 3.59s (± 2.98%) 3.60s (± 1.42%) ~ 3.54s 3.68s p=0.748 n=6
Total Time 55.51s (± 0.86%) 55.38s (± 0.47%) ~ 54.95s 55.63s p=0.810 n=6
self-compiler - node (v18.15.0, x64)
Errors 0 0 ~ ~ ~ p=1.000 n=6
Symbols 263,419 262,452 -967 (- 0.37%) ~ ~ p=0.001 n=6
Types 107,098 107,012 -86 (- 0.08%) ~ ~ p=0.001 n=6
Memory used 441,743k (± 0.01%) 441,258k (± 0.01%) -485k (- 0.11%) 441,178k 441,338k p=0.005 n=6
Parse Time 4.36s (± 0.60%) 4.39s (± 0.75%) ~ 4.36s 4.45s p=0.198 n=6
Bind Time 1.64s (± 1.08%) 1.63s (± 0.55%) ~ 1.62s 1.64s p=0.557 n=6
Check Time 23.60s (± 0.33%) 23.24s (± 0.29%) -0.36s (- 1.53%) 23.13s 23.31s p=0.005 n=6
Emit Time 1.92s (± 0.72%) 1.90s (± 1.05%) ~ 1.89s 1.94s p=0.084 n=6
Total Time 31.51s (± 0.31%) 31.16s (± 0.20%) -0.35s (- 1.11%) 31.06s 31.20s p=0.005 n=6
ts-pre-modules - node (v18.15.0, x64)
Errors 71 71 ~ ~ ~ p=1.000 n=6
Symbols 225,981 225,347 -634 (- 0.28%) ~ ~ p=0.001 n=6
Types 94,356 94,289 -67 (- 0.07%) ~ ~ p=0.001 n=6
Memory used 371,383k (± 0.04%) 371,081k (± 0.04%) -302k (- 0.08%) 370,964k 371,384k p=0.031 n=6
Parse Time 2.90s (± 0.94%) 2.90s (± 0.87%) ~ 2.86s 2.92s p=0.803 n=6
Bind Time 1.60s (± 1.42%) 1.60s (± 1.15%) ~ 1.58s 1.62s p=1.000 n=6
Check Time 16.54s (± 0.19%) 16.23s (± 0.21%) -0.31s (- 1.87%) 16.19s 16.29s p=0.005 n=6
Emit Time 0.00s 0.00s ~ ~ ~ p=1.000 n=6
Total Time 21.04s (± 0.31%) 20.73s (± 0.17%) -0.31s (- 1.46%) 20.68s 20.78s p=0.005 n=6
vscode - node (v18.15.0, x64)
Errors 51 51 ~ ~ ~ p=1.000 n=6
Symbols 3,419,902 3,419,526 -376 (- 0.01%) ~ ~ p=0.001 n=6
Types 1,154,016 1,153,443 -573 (- 0.05%) ~ ~ p=0.001 n=6
Memory used 3,472,233k (± 0.01%) 3,469,063k (± 0.01%) -3,171k (- 0.09%) 3,468,667k 3,469,373k p=0.005 n=6
Parse Time 18.22s (± 0.46%) 18.25s (± 0.67%) ~ 18.14s 18.48s p=0.809 n=6
Bind Time 5.79s (± 0.66%) 5.77s (± 0.62%) ~ 5.72s 5.83s p=0.260 n=6
Check Time 116.08s (± 3.18%) 113.61s (± 2.27%) ~ 111.83s 118.40s p=0.336 n=6
Emit Time 37.25s (± 2.27%) 36.53s (± 1.84%) ~ 36.05s 37.87s p=0.230 n=6
Total Time 177.35s (± 2.50%) 174.17s (± 1.84%) ~ 171.88s 180.35s p=0.378 n=6
webpack - node (v18.15.0, x64)
Errors 2 2 ~ ~ ~ p=1.000 n=6
Symbols 317,848 317,740 -108 (- 0.03%) ~ ~ p=0.001 n=6
Types 140,485 140,433 -52 (- 0.04%) ~ ~ p=0.001 n=6
Memory used 472,966k (± 0.01%) 472,774k (± 0.01%) -191k (- 0.04%) 472,693k 472,846k p=0.005 n=6
Parse Time 3.36s (± 0.85%) 3.37s (± 0.93%) ~ 3.34s 3.43s p=0.405 n=6
Bind Time 1.51s (± 0.27%) 1.51s (± 0.65%) ~ 1.49s 1.52s p=0.673 n=6
Check Time 17.48s (± 0.11%) 17.44s (± 0.30%) ~ 17.36s 17.49s p=0.293 n=6
Emit Time 0.00s 0.00s ~ ~ ~ p=1.000 n=6
Total Time 22.35s (± 0.09%) 22.32s (± 0.31%) ~ 22.23s 22.42s p=0.335 n=6
xstate-main - node (v18.15.0, x64)
Errors 5 5 ~ ~ ~ p=1.000 n=6
Symbols 570,733 567,169 -3,564 (- 0.62%) ~ ~ p=0.001 n=6
Types 191,446 190,593 -853 (- 0.45%) ~ ~ p=0.001 n=6
Memory used 501,289k (± 0.03%) 499,538k (± 0.01%) -1,751k (- 0.35%) 499,454k 499,591k p=0.005 n=6
Parse Time 3.46s (± 0.42%) 3.45s (± 0.87%) ~ 3.42s 3.50s p=0.290 n=6
Bind Time 1.22s (± 1.85%) 1.22s (± 0.68%) ~ 1.21s 1.23s p=0.138 n=6
Check Time 20.40s (± 2.94%) 20.11s (± 0.55%) ~ 19.94s 20.27s p=0.127 n=6
Emit Time 0.00s 0.00s ~ ~ ~ p=1.000 n=6
Total Time 25.07s (± 2.40%) 24.78s (± 0.53%) ~ 24.59s 24.97s p=0.415 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

Developer Information:

Download Benchmarks

@typescript-bot
Copy link
Collaborator

@ahejlsberg Here are the results of running the top 400 repos with tsc comparing main and refs/pull/61668/merge:

Something interesting changed - please have a look.

Details

apollographql/apollo-client

3 of 13 projects failed to build with the old tsc and were ignored

eslint-local-rules/tsconfig.json

@ahejlsberg
Copy link
Member Author

@typescript-bot test it

@typescript-bot
Copy link
Collaborator

typescript-bot commented May 8, 2025

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-bot
Copy link
Collaborator

Hey @ahejlsberg, the results of running the DT tests are ready.

Everything looks the same!

You can check the log here.

@typescript-bot
Copy link
Collaborator

@ahejlsberg Here are the results of running the user tests with tsc comparing main and refs/pull/61668/merge:

Something interesting changed - please have a look.

Details

fp-ts

tsconfig.json

  • [NEW] error TS2345: Argument of type 'Option<[Option<number>, Option<number>, Option<number>]>' is not assignable to parameter of type 'Option<NonEmptyArray<Some<number>>>'.
  • [NEW] error TS2345: Argument of type 'Option<[Option<number>, Option<number>]>' is not assignable to parameter of type 'Option<NonEmptyArray<Some<number>>>'.
  • [NEW] error TS2345: Argument of type '<C>(bc: readonly [C, 1]) => readonly [C, string]' is not assignable to parameter of type '(a: readonly [true, 2]) => readonly [true, string]'.

tsconfig.eslint.json

  • [NEW] error TS2345: Argument of type 'Option<[Option<number>, Option<number>, Option<number>]>' is not assignable to parameter of type 'Option<NonEmptyArray<Some<number>>>'.
  • [NEW] error TS2345: Argument of type 'Option<[Option<number>, Option<number>]>' is not assignable to parameter of type 'Option<NonEmptyArray<Some<number>>>'.
  • [NEW] error TS2345: Argument of type '<C>(bc: readonly [C, 1]) => readonly [C, string]' is not assignable to parameter of type '(a: readonly [true, 2]) => readonly [true, string]'.

@typescript-bot
Copy link
Collaborator

@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 - node (v18.15.0, x64)
Errors 34 34 ~ ~ ~ p=1.000 n=6
Symbols 62,390 62,370 -20 (- 0.03%) ~ ~ p=0.001 n=6
Types 50,395 50,386 -9 (- 0.02%) ~ ~ p=0.001 n=6
Memory used 192,980k (± 0.01%) 194,205k (± 0.95%) ~ 192,905k 196,581k p=1.000 n=6
Parse Time 1.31s (± 0.84%) 1.31s (± 0.39%) ~ 1.30s 1.31s p=0.324 n=6
Bind Time 0.73s 0.73s ~ ~ ~ p=1.000 n=6
Check Time 9.74s (± 0.36%) 9.72s (± 0.53%) ~ 9.63s 9.77s p=1.000 n=6
Emit Time 2.73s (± 0.89%) 2.73s (± 0.89%) ~ 2.71s 2.77s p=1.000 n=6
Total Time 14.51s (± 0.28%) 14.49s (± 0.39%) ~ 14.39s 14.56s p=0.685 n=6
angular-1 - node (v18.15.0, x64)
Errors 56 56 ~ ~ ~ p=1.000 n=6
Symbols 949,240 948,689 -551 (- 0.06%) ~ ~ p=0.001 n=6
Types 411,065 410,864 -201 (- 0.05%) ~ ~ p=0.001 n=6
Memory used 1,225,104k (± 0.00%) 1,224,498k (± 0.01%) -606k (- 0.05%) 1,224,409k 1,224,589k p=0.005 n=6
Parse Time 6.64s (± 0.68%) 6.64s (± 0.76%) ~ 6.57s 6.71s p=1.000 n=6
Bind Time 1.89s (± 0.40%) 1.88s (± 0.27%) ~ 1.88s 1.89s p=0.069 n=6
Check Time 31.99s (± 0.35%) 31.70s (± 0.40%) -0.28s (- 0.89%) 31.60s 31.95s p=0.013 n=6
Emit Time 15.23s (± 0.43%) 15.21s (± 0.35%) ~ 15.13s 15.28s p=0.630 n=6
Total Time 55.76s (± 0.18%) 55.44s (± 0.12%) -0.32s (- 0.57%) 55.36s 55.54s p=0.005 n=6
mui-docs - node (v18.15.0, x64)
Errors 0 0 ~ ~ ~ p=1.000 n=6
Symbols 2,439,929 2,437,696 -2,233 (- 0.09%) ~ ~ p=0.001 n=6
Types 872,556 872,504 -52 (- 0.01%) ~ ~ p=0.001 n=6
Memory used 2,448,236k (± 0.00%) 2,448,075k (± 0.00%) -161k (- 0.01%) 2,448,050k 2,448,124k p=0.005 n=6
Parse Time 8.74s (± 0.29%) 8.74s (± 0.60%) ~ 8.70s 8.84s p=0.686 n=6
Bind Time 2.21s (± 0.60%) 2.22s (± 0.62%) ~ 2.19s 2.23s p=0.216 n=6
Check Time 72.46s (± 0.46%) 72.38s (± 0.38%) ~ 72.09s 72.65s p=0.810 n=6
Emit Time 0.30s (± 1.70%) 0.30s (± 2.49%) ~ 0.29s 0.31s p=0.784 n=6
Total Time 83.72s (± 0.41%) 83.64s (± 0.29%) ~ 83.34s 83.88s p=0.688 n=6
self-build-src - node (v18.15.0, x64)
Errors 0 0 ~ ~ ~ p=1.000 n=6
Symbols 1,228,052 1,226,274 -1,778 (- 0.14%) ~ ~ p=0.001 n=6
Types 267,262 267,111 -151 (- 0.06%) ~ ~ p=0.001 n=6
Memory used 2,360,832k (± 0.02%) 2,360,123k (± 0.01%) -710k (- 0.03%) 2,359,794k 2,360,420k p=0.013 n=6
Parse Time 5.22s (± 0.89%) 5.23s (± 1.28%) ~ 5.13s 5.32s p=0.521 n=6
Bind Time 1.80s (± 1.05%) 1.80s (± 0.76%) ~ 1.78s 1.82s p=0.935 n=6
Check Time 35.43s (± 0.39%) 35.14s (± 0.39%) -0.29s (- 0.82%) 34.97s 35.29s p=0.020 n=6
Emit Time 2.99s (± 0.70%) 3.03s (± 0.99%) ~ 2.99s 3.07s p=0.092 n=6
Total Time 45.44s (± 0.27%) 45.20s (± 0.24%) -0.24s (- 0.53%) 45.09s 45.35s p=0.013 n=6
self-build-src-public-api - node (v18.15.0, x64)
Errors 0 0 ~ ~ ~ p=1.000 n=6
Symbols 1,228,052 1,226,274 -1,778 (- 0.14%) ~ ~ p=0.001 n=6
Types 267,262 267,111 -151 (- 0.06%) ~ ~ p=0.001 n=6
Memory used 2,916,430k (±12.89%) 2,915,467k (±12.83%) ~ 2,430,145k 3,158,297k p=0.298 n=6
Parse Time 6.92s (± 1.43%) 6.91s (± 1.68%) ~ 6.77s 7.02s p=0.872 n=6
Bind Time 2.20s (± 1.10%) 2.20s (± 1.17%) ~ 2.16s 2.24s p=0.810 n=6
Check Time 42.86s (± 0.54%) 42.52s (± 0.60%) ~ 42.07s 42.73s p=0.066 n=6
Emit Time 3.54s (± 1.57%) 3.50s (± 2.03%) ~ 3.44s 3.62s p=0.172 n=6
Total Time 55.53s (± 0.66%) 55.14s (± 0.72%) ~ 54.47s 55.50s p=0.173 n=6
self-compiler - node (v18.15.0, x64)
Errors 0 0 ~ ~ ~ p=1.000 n=6
Symbols 263,419 262,370 -1,049 (- 0.40%) ~ ~ p=0.001 n=6
Types 107,098 106,977 -121 (- 0.11%) ~ ~ p=0.001 n=6
Memory used 441,760k (± 0.03%) 441,354k (± 0.02%) -407k (- 0.09%) 441,220k 441,417k p=0.005 n=6
Parse Time 3.58s (± 1.04%) 3.56s (± 1.00%) ~ 3.49s 3.59s p=0.421 n=6
Bind Time 1.32s (± 0.62%) 1.33s (± 0.79%) ~ 1.31s 1.34s p=0.181 n=6
Check Time 19.03s (± 0.56%) 18.81s (± 0.45%) -0.21s (- 1.12%) 18.73s 18.97s p=0.020 n=6
Emit Time 1.53s (± 1.47%) 1.54s (± 0.90%) ~ 1.52s 1.55s p=0.935 n=6
Total Time 25.45s (± 0.34%) 25.22s (± 0.49%) -0.23s (- 0.89%) 25.08s 25.43s p=0.016 n=6
ts-pre-modules - node (v18.15.0, x64)
Errors 71 71 ~ ~ ~ p=1.000 n=6
Symbols 225,981 225,327 -654 (- 0.29%) ~ ~ p=0.001 n=6
Types 94,356 94,286 -70 (- 0.07%) ~ ~ p=0.001 n=6
Memory used 371,324k (± 0.05%) 371,021k (± 0.00%) -304k (- 0.08%) 371,004k 371,052k p=0.005 n=6
Parse Time 2.91s (± 1.33%) 2.89s (± 0.52%) ~ 2.88s 2.91s p=0.144 n=6
Bind Time 1.60s (± 1.02%) 1.61s (± 1.47%) ~ 1.59s 1.64s p=0.370 n=6
Check Time 16.55s (± 0.55%) 16.29s (± 0.35%) -0.26s (- 1.58%) 16.20s 16.37s p=0.005 n=6
Emit Time 0.00s (±244.70%) 0.00s (±244.70%) ~ 0.00s 0.01s p=1.000 n=6
Total Time 21.06s (± 0.51%) 20.79s (± 0.33%) -0.27s (- 1.27%) 20.70s 20.90s p=0.005 n=6
vscode - node (v18.15.0, x64)
Errors 51 51 ~ ~ ~ p=1.000 n=6
Symbols 3,420,238 3,417,911 -2,327 (- 0.07%) ~ ~ p=0.001 n=6
Types 1,153,895 1,153,270 -625 (- 0.05%) ~ ~ p=0.001 n=6
Memory used 3,471,974k (± 0.00%) 3,468,274k (± 0.00%) -3,700k (- 0.11%) 3,468,154k 3,468,426k p=0.005 n=6
Parse Time 14.65s (± 0.52%) 14.79s (± 2.83%) ~ 14.50s 15.63s p=0.936 n=6
Bind Time 4.71s (± 0.55%) 4.72s (± 0.97%) ~ 4.66s 4.77s p=0.936 n=6
Check Time 93.20s (± 1.62%) 95.02s (± 3.35%) ~ 91.47s 99.27s p=0.471 n=6
Emit Time 30.46s (± 1.67%) 30.24s (± 2.77%) ~ 29.49s 31.57s p=0.378 n=6
Total Time 143.03s (± 1.23%) 144.77s (± 2.58%) ~ 140.22s 150.23s p=0.575 n=6
webpack - node (v18.15.0, x64)
Errors 2 2 ~ ~ ~ p=1.000 n=6
Symbols 317,848 317,740 -108 (- 0.03%) ~ ~ p=0.001 n=6
Types 140,485 140,433 -52 (- 0.04%) ~ ~ p=0.001 n=6
Memory used 473,156k (± 0.02%) 472,831k (± 0.02%) -325k (- 0.07%) 472,612k 472,908k p=0.005 n=6
Parse Time 5.17s (± 0.85%) 5.14s (± 0.87%) ~ 5.08s 5.19s p=0.462 n=6
Bind Time 2.25s (± 1.39%) 2.27s (± 1.77%) ~ 2.21s 2.31s p=0.373 n=6
Check Time 25.96s (± 0.43%) 25.91s (± 0.34%) ~ 25.78s 26.01s p=0.422 n=6
Emit Time 0.00s (±244.70%) 0.00s (±154.76%) ~ 0.00s 0.01s p=0.595 n=6
Total Time 33.38s (± 0.34%) 33.34s (± 0.27%) ~ 33.25s 33.48s p=0.575 n=6
xstate-main - node (v18.15.0, x64)
Errors 5 5 ~ ~ ~ p=1.000 n=6
Symbols 570,733 573,794 +3,061 (+ 0.54%) ~ ~ p=0.001 n=6
Types 191,446 191,468 +22 (+ 0.01%) ~ ~ p=0.001 n=6
Memory used 501,309k (± 0.01%) 502,066k (± 0.02%) +757k (+ 0.15%) 501,986k 502,217k p=0.005 n=6
Parse Time 4.29s (± 0.32%) 4.32s (± 0.31%) +0.03s (+ 0.62%) 4.30s 4.33s p=0.016 n=6
Bind Time 1.54s (± 1.58%) 1.54s (± 0.58%) ~ 1.53s 1.55s p=1.000 n=6
Check Time 24.92s (± 0.30%) 24.84s (± 0.24%) ~ 24.77s 24.93s p=0.226 n=6
Emit Time 0.00s (±244.70%) 0.00s ~ ~ ~ p=0.405 n=6
Total Time 30.75s (± 0.33%) 30.70s (± 0.15%) ~ 30.65s 30.77s 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

Developer Information:

Download Benchmarks

@typescript-bot
Copy link
Collaborator

@ahejlsberg Here are the results of running the top 400 repos with tsc comparing main and refs/pull/61668/merge:

Everything looks good!

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: Not started
Development

Successfully merging this pull request may close these issues.

Type variable leak and odd error React's ComponentProps type issues in TypeScript 5.6.2
2 participants