Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cache repeated mapper instantiations only within a single instantiation call #61535

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

Conversation

Andarist
Copy link
Contributor

@Andarist Andarist commented Apr 5, 2025

This is an alternative to #61505 , I hope this might have better memory consumption characteristics (at the expense of repeated work, the instantiations diff can be seen here).

@typescript-bot typescript-bot added the For Uncommitted Bug PR for untriaged, rejected, closed or missing bug label Apr 5, 2025
@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.

@Andarist Andarist force-pushed the cache-mapper-instaniations-limited branch from 5b50238 to 82666d1 Compare April 5, 2025 14:25
@jakebailey
Copy link
Member

@typescript-bot test it

@typescript-bot
Copy link
Collaborator

typescript-bot commented Apr 5, 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 @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/61535/merge:

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 34 34 ~ ~ ~ p=1.000 n=6
Symbols 62,390 62,390 ~ ~ ~ p=1.000 n=6
Types 50,395 50,395 ~ ~ ~ p=1.000 n=6
Memory used 193,593k (± 0.75%) 194,212k (± 0.94%) ~ 192,911k 196,559k p=0.173 n=6
Parse Time 1.31s (± 0.68%) 1.32s (± 0.42%) ~ 1.31s 1.32s p=0.341 n=6
Bind Time 0.73s 0.73s ~ ~ ~ p=1.000 n=6
Check Time 9.73s (± 0.25%) 9.76s (± 0.26%) ~ 9.72s 9.78s p=0.122 n=6
Emit Time 2.73s (± 0.43%) 2.73s (± 0.44%) ~ 2.71s 2.74s p=0.502 n=6
Total Time 14.50s (± 0.21%) 14.53s (± 0.12%) ~ 14.50s 14.55s p=0.142 n=6
angular-1 - node (v18.15.0, x64)
Errors 56 56 ~ ~ ~ p=1.000 n=6
Symbols 948,670 948,670 ~ ~ ~ p=1.000 n=6
Types 410,947 410,947 ~ ~ ~ p=1.000 n=6
Memory used 1,224,306k (± 0.01%) 1,224,405k (± 0.01%) +99k (+ 0.01%) 1,224,325k 1,224,519k p=0.045 n=6
Parse Time 6.67s (± 0.53%) 6.63s (± 0.95%) ~ 6.52s 6.69s p=0.295 n=6
Bind Time 1.89s (± 0.54%) 1.88s (± 0.62%) ~ 1.87s 1.90s p=0.117 n=6
Check Time 31.90s (± 0.19%) 32.08s (± 0.27%) +0.18s (+ 0.55%) 31.97s 32.20s p=0.006 n=6
Emit Time 15.31s (± 0.25%) 15.27s (± 0.32%) ~ 15.19s 15.33s p=0.172 n=6
Total Time 55.78s (± 0.18%) 55.86s (± 0.31%) ~ 55.56s 56.06s p=0.378 n=6
mui-docs - node (v18.15.0, x64)
Errors 0 0 ~ ~ ~ p=1.000 n=6
Symbols 2,460,251 2,460,251 ~ ~ ~ p=1.000 n=6
Types 892,981 892,981 ~ ~ ~ p=1.000 n=6
Memory used 2,308,123k (± 0.00%) 2,308,868k (± 0.00%) +745k (+ 0.03%) 2,308,843k 2,308,929k p=0.005 n=6
Parse Time 9.03s (± 0.26%) 9.00s (± 0.16%) -0.03s (- 0.37%) 8.97s 9.01s p=0.011 n=6
Bind Time 2.26s (± 0.46%) 2.27s (± 0.39%) ~ 2.26s 2.28s p=0.344 n=6
Check Time 75.82s (± 0.30%) 75.82s (± 0.55%) ~ 75.14s 76.27s p=0.810 n=6
Emit Time 0.29s 0.29s ~ ~ ~ p=1.000 n=6
Total Time 87.41s (± 0.25%) 87.38s (± 0.49%) ~ 86.67s 87.83s p=0.810 n=6
self-build-src - node (v18.15.0, x64)
Errors 0 0 ~ ~ ~ p=1.000 n=6
Symbols 1,226,719 1,226,771 +52 (+ 0.00%) ~ ~ p=0.001 n=6
Types 266,996 267,003 +7 (+ 0.00%) ~ ~ p=0.001 n=6
Memory used 2,357,318k (± 0.02%) 2,357,853k (± 0.03%) ~ 2,356,787k 2,359,113k p=0.173 n=6
Parse Time 5.19s (± 1.21%) 5.20s (± 0.98%) ~ 5.14s 5.29s p=0.810 n=6
Bind Time 1.79s (± 1.66%) 1.78s (± 1.40%) ~ 1.74s 1.81s p=0.624 n=6
Check Time 35.34s (± 0.26%) 35.45s (± 0.25%) ~ 35.35s 35.59s p=0.093 n=6
Emit Time 3.08s (± 3.18%) 3.00s (± 2.32%) ~ 2.93s 3.12s p=0.091 n=6
Total Time 45.41s (± 0.25%) 45.44s (± 0.35%) ~ 45.23s 45.64s p=0.810 n=6
self-build-src-public-api - node (v18.15.0, x64)
Errors 0 0 ~ ~ ~ p=1.000 n=6
Symbols 1,226,719 1,226,771 +52 (+ 0.00%) ~ ~ p=0.001 n=6
Types 266,996 267,003 +7 (+ 0.00%) ~ ~ p=0.001 n=6
Memory used 3,153,487k (± 0.03%) 2,912,205k (±12.87%) ~ 2,426,444k 3,154,877k p=1.000 n=6
Parse Time 7.03s (± 0.85%) 6.96s (± 1.32%) ~ 6.83s 7.09s p=0.199 n=6
Bind Time 2.16s (± 1.22%) 2.15s (± 1.36%) ~ 2.10s 2.18s p=0.810 n=6
Check Time 42.97s (± 0.43%) 43.09s (± 0.57%) ~ 42.76s 43.51s p=0.471 n=6
Emit Time 3.52s (± 1.38%) 3.57s (± 4.16%) ~ 3.29s 3.72s p=0.128 n=6
Total Time 55.67s (± 0.35%) 55.78s (± 0.71%) ~ 55.07s 56.29s p=0.378 n=6
self-compiler - node (v18.15.0, x64)
Errors 0 0 ~ ~ ~ p=1.000 n=6
Symbols 262,674 262,726 +52 (+ 0.02%) ~ ~ p=0.001 n=6
Types 106,849 106,856 +7 (+ 0.01%) ~ ~ p=0.001 n=6
Memory used 440,482k (± 0.01%) 440,492k (± 0.01%) ~ 440,461k 440,542k p=1.000 n=6
Parse Time 3.57s (± 0.84%) 3.52s (± 0.66%) -0.06s (- 1.59%) 3.48s 3.54s p=0.013 n=6
Bind Time 1.32s (± 0.83%) 1.32s (± 0.39%) ~ 1.31s 1.32s p=0.784 n=6
Check Time 18.93s (± 0.47%) 19.03s (± 0.36%) +0.11s (+ 0.56%) 18.93s 19.11s p=0.044 n=6
Emit Time 1.52s (± 0.93%) 1.52s (± 1.46%) ~ 1.48s 1.54s p=0.622 n=6
Total Time 25.34s (± 0.36%) 25.39s (± 0.34%) ~ 25.28s 25.51s p=0.336 n=6
ts-pre-modules - node (v18.15.0, x64)
Errors 71 71 ~ ~ ~ p=1.000 n=6
Symbols 225,981 225,981 ~ ~ ~ p=1.000 n=6
Types 94,356 94,356 ~ ~ ~ p=1.000 n=6
Memory used 371,331k (± 0.06%) 371,235k (± 0.01%) ~ 371,197k 371,292k p=0.630 n=6
Parse Time 2.89s (± 1.30%) 2.91s (± 1.20%) ~ 2.87s 2.97s p=0.195 n=6
Bind Time 1.61s (± 1.36%) 1.59s (± 0.65%) ~ 1.58s 1.61s p=0.100 n=6
Check Time 16.48s (± 0.33%) 16.54s (± 0.47%) ~ 16.40s 16.63s p=0.106 n=6
Emit Time 0.00s 0.00s ~ ~ ~ p=1.000 n=6
Total Time 20.97s (± 0.46%) 21.04s (± 0.46%) ~ 20.89s 21.19s p=0.334 n=6
vscode - node (v18.15.0, x64)
Errors 4 4 ~ ~ ~ p=1.000 n=6
Symbols 3,337,504 3,337,504 ~ ~ ~ p=1.000 n=6
Types 1,131,017 1,131,017 ~ ~ ~ p=1.000 n=6
Memory used 3,395,657k (± 0.00%) 3,395,597k (± 0.01%) ~ 3,395,235k 3,395,759k p=0.936 n=6
Parse Time 14.56s (± 0.46%) 14.62s (± 0.77%) ~ 14.45s 14.76s p=0.335 n=6
Bind Time 4.62s (± 0.60%) 4.62s (± 0.40%) ~ 4.59s 4.64s p=0.936 n=6
Check Time 90.93s (± 1.39%) 91.76s (± 1.63%) ~ 90.56s 93.91s p=0.229 n=6
Emit Time 29.16s (± 0.36%) 29.38s (± 2.10%) ~ 28.93s 30.53s p=0.688 n=6
Total Time 139.27s (± 0.93%) 140.38s (± 1.35%) ~ 138.86s 143.60s p=0.230 n=6
webpack - node (v18.15.0, x64)
Errors 2 2 ~ ~ ~ p=1.000 n=6
Symbols 311,741 311,741 ~ ~ ~ p=1.000 n=6
Types 137,137 137,137 ~ ~ ~ p=1.000 n=6
Memory used 466,660k (± 0.01%) 466,577k (± 0.02%) ~ 466,517k 466,711k p=0.093 n=6
Parse Time 5.13s (± 0.98%) 5.11s (± 0.20%) ~ 5.10s 5.13s p=1.000 n=6
Bind Time 2.27s (± 0.82%) 2.27s (± 0.53%) ~ 2.25s 2.28s p=0.463 n=6
Check Time 25.49s (± 0.22%) 25.50s (± 0.40%) ~ 25.39s 25.63s p=0.936 n=6
Emit Time 0.00s (±244.70%) 0.00s (±244.70%) ~ 0.00s 0.01s p=1.000 n=6
Total Time 32.89s (± 0.27%) 32.88s (± 0.31%) ~ 32.78s 33.02s p=1.000 n=6
xstate-main - node (v18.15.0, x64)
Errors 5 5 ~ ~ ~ p=1.000 n=6
Symbols 567,397 567,397 ~ ~ ~ p=1.000 n=6
Types 190,073 190,073 ~ ~ ~ p=1.000 n=6
Memory used 497,982k (± 0.01%) 499,595k (± 0.01%) +1,613k (+ 0.32%) 499,546k 499,633k p=0.005 n=6
Parse Time 3.35s (± 0.62%) 3.37s (± 0.89%) ~ 3.33s 3.42s p=0.568 n=6
Bind Time 1.21s (± 1.35%) 1.21s (± 1.32%) ~ 1.18s 1.22s p=0.742 n=6
Check Time 20.03s (± 0.28%) 19.55s (± 0.24%) -0.47s (- 2.36%) 19.50s 19.61s p=0.005 n=6
Emit Time 0.00s 0.00s ~ ~ ~ p=1.000 n=6
Total Time 24.59s (± 0.33%) 24.13s (± 0.20%) -0.46s (- 1.86%) 24.05s 24.17s p=0.005 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/61535/merge:

Everything looks good!

@Andarist
Copy link
Contributor Author

Andarist commented Apr 5, 2025

FWIW, check times for AnswerOverflow/AnswerOverflow/apps/dashboard:

TS 5.8

6.44
6.58
6.99
6.33
7.00

PR #61505 at commit a6a728f

3.25
3.34
3.21
3.24
3.43

This PR (#61535) at commit 82666d1:

3.22
3.18
3.22
3.18
3.43

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
For Uncommitted Bug PR for untriaged, rejected, closed or missing bug
Projects
Status: Not started
Development

Successfully merging this pull request may close these issues.

3 participants