Skip to content

Un‑consolidate and fix WeakMap constructor overloads#56713

Merged
jakebailey merged 3 commits intomicrosoft:mainfrom
ExE-Boss:fix/gh-23551
Feb 7, 2026
Merged

Un‑consolidate and fix WeakMap constructor overloads#56713
jakebailey merged 3 commits intomicrosoft:mainfrom
ExE-Boss:fix/gh-23551

Conversation

@ExE-Boss
Copy link
Contributor

@ExE-Boss ExE-Boss commented Dec 8, 2023

Fixes #56664
Fixes #27951 for WeakMap.
Fixes #23551 which regressed as a result of #28052 only changing the Iterable‑taking constructor overload.


See also: #41635

@typescript-bot typescript-bot added the For Uncommitted Bug PR for untriaged, rejected, closed or missing bug label Dec 8, 2023
@typescript-bot
Copy link
Collaborator

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

@typescript-bot typescript-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 Dec 8, 2023
@typescript-bot typescript-bot added the For Milestone Bug PRs that fix a bug with a specific milestone label Dec 8, 2023
@sandersn sandersn requested review from rbuckton and sandersn January 4, 2024 22:43
Copy link
Member

@sandersn sandersn left a comment

Choose a reason for hiding this comment

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

Looks reasonable, but I have one question and I'd like a second opinion from @rbuckton.

@ExE-Boss ExE-Boss requested a review from sandersn January 5, 2024 18:43
@jakebailey jakebailey removed the request for review from rbuckton February 6, 2026 22:00
@jakebailey
Copy link
Member

@typescript-bot test it

@typescript-bot
Copy link
Collaborator

typescript-bot commented Feb 6, 2026

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 @jakebailey, the results of running the DT tests are ready.

Everything looks the same!

You can check the log here.

@typescript-bot
Copy link
Collaborator

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

There were infrastructure failures potentially unrelated to your change:

  • 1 instance of "Git clone failed"

Otherwise...

Everything looks good!

@typescript-bot
Copy link
Collaborator

@jakebailey
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 3 3 ~ ~ ~ p=1.000 n=6
Symbols 82,521 82,521 ~ ~ ~ p=1.000 n=6
Types 125,280 125,280 ~ ~ ~ p=1.000 n=6
Memory used 277,173k (± 0.52%) 277,223k (± 0.53%) ~ 274,231k 277,985k p=0.230 n=6
Parse Time 1.60s (± 1.14%) 1.60s (± 1.23%) ~ 1.57s 1.63s p=0.739 n=6
Bind Time 0.90s (± 1.30%) 0.90s (± 1.63%) ~ 0.88s 0.92s p=1.000 n=6
Check Time 17.51s (± 1.87%) 17.50s (± 1.99%) ~ 16.81s 17.77s p=1.000 n=6
Emit Time 3.24s (± 1.30%) 3.26s (± 0.60%) ~ 3.24s 3.29s p=0.332 n=6
Total Time 23.25s (± 1.52%) 23.26s (± 1.51%) ~ 22.57s 23.52s p=1.000 n=6
angular-1 - node (v18.15.0, x64)
Errors 3 3 ~ ~ ~ p=1.000 n=6
Symbols 955,840 955,840 ~ ~ ~ p=1.000 n=6
Types 415,853 415,851 -2 (- 0.00%) ~ ~ p=0.001 n=6
Memory used 1,255,054k (± 0.00%) 1,255,054k (± 0.01%) ~ 1,254,946k 1,255,109k p=0.810 n=6
Parse Time 7.99s (± 0.52%) 7.94s (± 0.42%) ~ 7.89s 7.98s p=0.053 n=6
Bind Time 2.38s (± 0.75%) 2.39s (± 0.64%) ~ 2.36s 2.40s p=0.683 n=6
Check Time 38.75s (± 0.34%) 38.87s (± 0.37%) ~ 38.63s 39.02s p=0.090 n=6
Emit Time 17.96s (± 0.28%) 18.02s (± 0.68%) ~ 17.82s 18.16s p=0.228 n=6
Total Time 67.07s (± 0.21%) 67.23s (± 0.34%) ~ 66.86s 67.48s p=0.261 n=6
mui-docs - node (v18.15.0, x64)
Errors 11,439 11,439 ~ ~ ~ p=1.000 n=6
Symbols 2,703,113 2,703,113 ~ ~ ~ p=1.000 n=6
Types 931,060 931,058 -2 (- 0.00%) ~ ~ p=0.001 n=6
Memory used 3,039,352k (± 0.00%) 3,039,355k (± 0.00%) ~ 3,039,238k 3,039,420k p=0.936 n=6
Parse Time 12.65s (± 1.02%) 12.70s (± 0.41%) ~ 12.62s 12.78s p=0.936 n=6
Bind Time 3.41s (± 0.88%) 3.41s (± 0.91%) ~ 3.37s 3.46s p=0.871 n=6
Check Time 135.83s (± 0.95%) 136.16s (± 1.52%) ~ 134.00s 139.53s p=0.936 n=6
Emit Time 0.46s (± 3.25%) 0.47s (± 2.10%) ~ 0.45s 0.48s p=0.357 n=6
Total Time 152.36s (± 0.83%) 152.75s (± 1.35%) ~ 150.56s 156.09s p=0.810 n=6
self-build-src - node (v18.15.0, x64)
Errors 0 0 ~ ~ ~ p=1.000 n=6
Symbols 1,253,400 1,253,400 ~ ~ ~ p=1.000 n=6
Types 260,196 260,194 -2 (- 0.00%) ~ ~ p=0.001 n=6
Memory used 3,008,696k (± 9.92%) 3,130,243k (± 0.03%) ~ 3,128,615k 3,131,581k p=0.936 n=6
Parse Time 6.67s (± 1.84%) 6.71s (± 0.76%) ~ 6.62s 6.78s p=0.810 n=6
Bind Time 2.21s (± 1.58%) 2.22s (± 0.68%) ~ 2.20s 2.24s p=0.936 n=6
Check Time 43.22s (± 0.32%) 43.21s (± 0.46%) ~ 42.95s 43.49s p=1.000 n=6
Emit Time 3.47s (± 3.44%) 3.51s (± 1.64%) ~ 3.42s 3.58s p=0.810 n=6
Total Time 55.58s (± 0.28%) 55.64s (± 0.37%) ~ 55.35s 55.92s p=0.689 n=6
self-build-src-public-api - node (v18.15.0, x64)
Errors 0 0 ~ ~ ~ p=1.000 n=6
Symbols 1,253,400 1,253,400 ~ ~ ~ p=1.000 n=6
Types 260,196 260,194 -2 (- 0.00%) ~ ~ p=0.001 n=6
Memory used 3,194,656k (± 0.02%) 3,193,786k (± 0.02%) ~ 3,193,298k 3,194,584k p=0.066 n=6
Parse Time 6.88s (± 0.73%) 6.88s (± 1.14%) ~ 6.76s 6.99s p=1.000 n=6
Bind Time 2.27s (± 1.45%) 2.25s (± 0.73%) ~ 2.22s 2.27s p=0.170 n=6
Check Time 43.43s (± 0.12%) 43.39s (± 0.40%) ~ 43.17s 43.66s p=0.689 n=6
Emit Time 3.47s (± 3.73%) 3.52s (± 2.27%) ~ 3.39s 3.64s p=0.470 n=6
Total Time 56.05s (± 0.26%) 56.03s (± 0.30%) ~ 55.86s 56.31s p=0.689 n=6
self-compiler - node (v18.15.0, x64)
Errors 0 0 ~ ~ ~ p=1.000 n=6
Symbols 265,166 265,166 ~ ~ ~ p=1.000 n=6
Types 104,270 104,268 -2 (- 0.00%) ~ ~ p=0.001 n=6
Memory used 444,537k (± 0.02%) 444,561k (± 0.01%) ~ 444,476k 444,627k p=0.575 n=6
Parse Time 3.53s (± 0.77%) 3.52s (± 0.66%) ~ 3.49s 3.56s p=0.366 n=6
Bind Time 1.37s (± 0.55%) 1.37s (± 0.75%) ~ 1.36s 1.39s p=0.437 n=6
Check Time 19.30s (± 0.46%) 19.32s (± 0.29%) ~ 19.25s 19.40s p=0.872 n=6
Emit Time 1.55s (± 1.32%) 1.54s (± 1.12%) ~ 1.52s 1.57s p=0.326 n=6
Total Time 25.75s (± 0.37%) 25.75s (± 0.25%) ~ 25.66s 25.84s p=0.936 n=6
ts-pre-modules - node (v18.15.0, x64)
Errors 271 271 ~ ~ ~ p=1.000 n=6
Symbols 225,135 225,162 +27 (+ 0.01%) ~ ~ p=0.001 n=6
Types 93,554 93,564 +10 (+ 0.01%) ~ ~ p=0.001 n=6
Memory used 370,625k (± 0.03%) 370,613k (± 0.01%) ~ 370,551k 370,669k p=0.936 n=6
Parse Time 2.82s (± 1.58%) 2.83s (± 1.04%) ~ 2.80s 2.88s p=0.169 n=6
Bind Time 1.64s (± 0.90%) 1.63s (± 0.74%) ~ 1.62s 1.65s p=0.325 n=6
Check Time 17.44s (± 0.28%) 17.43s (± 0.41%) ~ 17.31s 17.50s p=1.000 n=6
Emit Time 0.00s 0.00s ~ ~ ~ p=1.000 n=6
Total Time 21.91s (± 0.33%) 21.90s (± 0.44%) ~ 21.76s 22.01s p=1.000 n=6
vscode - node (v18.15.0, x64)
Errors 11 11 ~ ~ ~ p=1.000 n=6
Symbols 4,226,927 4,226,927 ~ ~ ~ p=1.000 n=6
Types 1,342,245 1,342,247 +2 (+ 0.00%) ~ ~ p=0.001 n=6
Memory used 4,019,894k (± 0.00%) 4,019,962k (± 0.00%) ~ 4,019,764k 4,020,183k p=0.423 n=6
Parse Time 16.24s (± 0.49%) 16.22s (± 0.34%) ~ 16.13s 16.29s p=0.810 n=6
Bind Time 5.78s (±12.98%) 5.49s (± 0.41%) ~ 5.46s 5.53s p=0.936 n=6
Check Time 121.25s (± 3.76%) 124.14s (± 3.75%) ~ 120.96s 133.14s p=0.298 n=6
Emit Time 49.95s (±10.48%) 48.61s (± 9.67%) ~ 45.32s 57.08s p=0.689 n=6
Total Time 193.23s (± 3.08%) 194.47s (± 3.01%) ~ 188.42s 202.68s p=0.936 n=6
webpack - node (v18.15.0, x64)
Errors 41 41 ~ ~ ~ p=1.000 n=6
Symbols 402,249 402,249 ~ ~ ~ p=1.000 n=6
Types 178,120 178,122 +2 (+ 0.00%) ~ ~ p=0.001 n=6
Memory used 559,168k (± 0.03%) 559,224k (± 0.04%) ~ 559,001k 559,660k p=0.471 n=6
Parse Time 4.75s (± 0.67%) 4.73s (± 0.13%) ~ 4.72s 4.74s p=0.158 n=6
Bind Time 2.02s (± 0.67%) 2.02s (± 1.21%) ~ 1.99s 2.06s p=0.932 n=6
Check Time 24.48s (± 0.45%) 24.41s (± 1.16%) ~ 23.94s 24.75s p=0.688 n=6
Emit Time 0.00s (±244.70%) 0.01s (±77.38%) ~ 0.00s 0.01s p=0.112 n=6
Total Time 31.26s (± 0.43%) 31.17s (± 0.92%) ~ 30.67s 31.51s p=0.748 n=6
xstate-main - node (v18.15.0, x64)
Errors 30 30 ~ ~ ~ p=1.000 n=6
Symbols 752,037 752,037 ~ ~ ~ p=1.000 n=6
Types 215,078 215,076 -2 (- 0.00%) ~ ~ p=0.001 n=6
Memory used 675,357k (± 0.00%) 675,398k (± 0.02%) ~ 675,242k 675,566k p=0.521 n=6
Parse Time 4.88s (± 0.42%) 4.90s (± 0.42%) ~ 4.87s 4.92s p=0.517 n=6
Bind Time 1.57s (± 0.62%) 1.58s (± 1.18%) ~ 1.55s 1.60s p=0.558 n=6
Check Time 22.26s (± 0.20%) 22.34s (± 0.55%) ~ 22.17s 22.53s p=0.170 n=6
Emit Time 0.00s 0.00s ~ ~ ~ p=1.000 n=6
Total Time 28.71s (± 0.20%) 28.82s (± 0.45%) ~ 28.63s 29.03s p=0.054 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

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

Everything looks good!

Copy link
Member

@DanielRosenwasser DanielRosenwasser left a comment

Choose a reason for hiding this comment

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

Don't love that there's more any, but most people were probably hitting the other overload anyway.

@github-project-automation github-project-automation bot moved this from Waiting on author to Needs merge in PR Backlog Feb 7, 2026
@jakebailey jakebailey added this pull request to the merge queue Feb 7, 2026
Merged via the queue into microsoft:main with commit e872a6e Feb 7, 2026
23 checks passed
@github-project-automation github-project-automation bot moved this from Needs merge to Done in PR Backlog Feb 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

For Backlog Bug PRs that fix a backlog bug For Milestone Bug PRs that fix a bug with a specific milestone

Projects

Status: Done

6 participants