Repository navigation
Commit 1482441
committed
Reuse ordered property counts during intersection reduction
Intersection reduction repeatedly allocates temporary property-count
tables. On MUI, this one allocation site accounts for roughly a quarter
of all allocated bytes, despite none of the tables needing to survive
the reduction. Reusing this workspace removes substantial allocation
churn without changing the first-seen property order or caching results.
Each recursive reduction borrows an independent checker-local table.
Returning a table clears its names and counts, including on early
returns; tables exceeding 4096 properties are not retained.
Against the parent commit, six fresh-process MUI single-checker pairs
save 1.36 GiB of allocation per run, reduce allocation events by 7.59%,
and reduce instructions by 6.02%. Default-threaded production MUI
instructions decrease 8.88%. Retained heap and scannable heap are
essentially unchanged: this is an allocation-churn optimization.
VS Code allocation savings are smaller. Production VS Code instructions
remain inconclusive after twelve pairs, with a higher point estimate;
Webpack instructions are also inconclusive. Wall times are noisy on
this shared host. All production diagnostic text and semantic counts
match between revisions.
The regression test allocated 21 times per warmed reduction before this
change and now allocates zero times. Tests also cover nested borrowing,
property order, clearing, oversized tables, and early-return cleanup.
Six fresh-process single-checker pairs, ordinary GC:
│ mui-property-counts-memory-before.txt │ mui-property-counts-memory-after.txt │
│ retained-B │ retained-B vs base │
ExternalMemory-20 1.492Gi ± 0% 1.492Gi ± 0% ~ (p=0.310 n=6)
│ mui-property-counts-memory-before.txt │ mui-property-counts-memory-after.txt │
│ scan-B │ scan-B vs base │
ExternalMemory-20 1.270Gi ± 0% 1.270Gi ± 0% ~ (p=0.310 n=6)
│ mui-property-counts-memory-before.txt │ mui-property-counts-memory-after.txt │
│ B/op │ B/op vs base │
ExternalMemory-20 5.122Gi ± 0% 3.757Gi ± 0% -26.64% (p=0.002 n=6)
│ mui-property-counts-memory-before.txt │ mui-property-counts-memory-after.txt │
│ allocs/op │ allocs/op vs base │
ExternalMemory-20 24.77M ± 0% 22.89M ± 0% -7.59% (p=0.002 n=6)
│ mui-property-counts-memory-before.instructions │ mui-property-counts-memory-after.instructions │
│ instructions/op │ instructions/op vs base │
mui-20 213.7G ± 3% 200.8G ± 3% -6.02% (p=0.002 n=6)
│ vscode-property-counts-memory-before.txt │ vscode-property-counts-memory-after.txt │
│ retained-B │ retained-B vs base │
ExternalMemory-20 2.615Gi ± 0% 2.615Gi ± 0% ~ (p=0.589 n=6)
│ vscode-property-counts-memory-before.txt │ vscode-property-counts-memory-after.txt │
│ scan-B │ scan-B vs base │
ExternalMemory-20 2.287Gi ± 0% 2.287Gi ± 0% ~ (p=0.589 n=6)
│ vscode-property-counts-memory-before.txt │ vscode-property-counts-memory-after.txt │
│ B/op │ B/op vs base │
ExternalMemory-20 3.749Gi ± 0% 3.714Gi ± 0% -0.92% (p=0.002 n=6)
│ vscode-property-counts-memory-before.txt │ vscode-property-counts-memory-after.txt │
│ allocs/op │ allocs/op vs base │
ExternalMemory-20 23.60M ± 0% 23.49M ± 0% -0.47% (p=0.002 n=6)
│ vscode-property-counts-memory-before.instructions │ vscode-property-counts-memory-after.instructions │
│ instructions/op │ instructions/op vs base │
vscode-20 193.0G ± 4% 193.2G ± 5% ~ (p=0.818 n=6)
Default-threaded production CLI (six pairs; VS Code twelve pairs):
│ mui-property-counts-cli-before.txt │ mui-property-counts-cli-after.txt │
│ heap-B/op │ heap-B/op vs base │
mui-20 1.867Gi ± 0% 1.868Gi ± 0% ~ (p=0.589 n=6)
│ mui-property-counts-cli-before.txt │ mui-property-counts-cli-after.txt │
│ allocs/op │ allocs/op vs base │
mui-20 29.52M ± 0% 27.84M ± 0% -5.69% (p=0.002 n=6)
│ mui-property-counts-cli-before.txt │ mui-property-counts-cli-after.txt │
│ check-sec/op │ check-sec/op vs base │
mui-20 11.59 ± 3% 10.67 ± 5% -7.86% (p=0.004 n=6)
│ mui-property-counts-cli-before.instructions │ mui-property-counts-cli-after.instructions │
│ instructions/op │ instructions/op vs base │
mui-20 274.6G ± 2% 250.2G ± 4% -8.88% (p=0.002 n=6)
│ vscode-property-counts-cli-before.txt │ vscode-property-counts-cli-after.txt │
│ heap-B/op │ heap-B/op vs base │
vscode-20 2.828Gi ± 0% 2.828Gi ± 0% ~ (p=0.843 n=12)
│ vscode-property-counts-cli-before.txt │ vscode-property-counts-cli-after.txt │
│ allocs/op │ allocs/op vs base │
vscode-20 36.62M ± 0% 36.54M ± 0% -0.21% (p=0.000 n=12)
│ vscode-property-counts-cli-before.txt │ vscode-property-counts-cli-after.txt │
│ check-sec/op │ check-sec/op vs base │
vscode-20 8.671 ± 21% 8.409 ± 26% ~ (p=0.799 n=12)
│ vscode-property-counts-cli-before.instructions │ vscode-property-counts-cli-after.instructions │
│ instructions/op │ instructions/op vs base │
vscode-20 296.5G ± 4% 307.6G ± 3% ~ (p=0.242 n=12)
│ webpack-property-counts-cli-before.txt │ webpack-property-counts-cli-after.txt │
│ heap-B/op │ heap-B/op vs base │
webpack-20 663.0Mi ± 0% 663.1Mi ± 0% ~ (p=0.699 n=6)
│ webpack-property-counts-cli-before.txt │ webpack-property-counts-cli-after.txt │
│ allocs/op │ allocs/op vs base │
webpack-20 6.208M ± 0% 6.096M ± 0% -1.80% (p=0.002 n=6)
│ webpack-property-counts-cli-before.txt │ webpack-property-counts-cli-after.txt │
│ check-sec/op │ check-sec/op vs base │
webpack-20 1.765 ± 8% 1.711 ± 6% ~ (p=0.180 n=6)
│ webpack-property-counts-cli-before.instructions │ webpack-property-counts-cli-after.instructions │
│ instructions/op │ instructions/op vs base │
webpack-20 52.37G ± 2% 51.78G ± 3% ~ (p=0.394 n=6)1 parent 2565d17 commit 1482441
3 files changed
Lines changed: 113 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
691 | 691 | | |
692 | 692 | | |
693 | 693 | | |
| 694 | + | |
694 | 695 | | |
695 | 696 | | |
696 | 697 | | |
| |||
22344 | 22345 | | |
22345 | 22346 | | |
22346 | 22347 | | |
22347 | | - | |
| 22348 | + | |
| 22349 | + | |
22348 | 22350 | | |
22349 | 22351 | | |
22350 | 22352 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
286 | 286 | | |
287 | 287 | | |
288 | 288 | | |
| 289 | + | |
| 290 | + | |
| 291 | + | |
| 292 | + | |
| 293 | + | |
| 294 | + | |
| 295 | + | |
| 296 | + | |
| 297 | + | |
| 298 | + | |
| 299 | + | |
| 300 | + | |
| 301 | + | |
| 302 | + | |
| 303 | + | |
| 304 | + | |
| 305 | + | |
| 306 | + | |
| 307 | + | |
| 308 | + | |
| 309 | + | |
| 310 | + | |
| 311 | + | |
| 312 | + | |
| 313 | + | |
| 314 | + | |
| 315 | + | |
| 316 | + | |
| 317 | + | |
| 318 | + | |
| 319 | + | |
| 320 | + | |
| 321 | + | |
| 322 | + | |
| 323 | + | |
| 324 | + | |
| 325 | + | |
| 326 | + | |
| 327 | + | |
| 328 | + | |
| 329 | + | |
| 330 | + | |
| 331 | + | |
| 332 | + | |
| 333 | + | |
| 334 | + | |
| 335 | + | |
| 336 | + | |
| 337 | + | |
| 338 | + | |
| 339 | + | |
| 340 | + | |
| 341 | + | |
| 342 | + | |
| 343 | + | |
| 344 | + | |
| 345 | + | |
| 346 | + | |
| 347 | + | |
| 348 | + | |
| 349 | + | |
| 350 | + | |
| 351 | + | |
| 352 | + | |
| 353 | + | |
| 354 | + | |
| 355 | + | |
| 356 | + | |
| 357 | + | |
| 358 | + | |
| 359 | + | |
| 360 | + | |
| 361 | + | |
| 362 | + | |
| 363 | + | |
| 364 | + | |
| 365 | + | |
| 366 | + | |
| 367 | + | |
| 368 | + | |
| 369 | + | |
| 370 | + | |
289 | 371 | | |
290 | 372 | | |
291 | 373 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
| 11 | + | |
11 | 12 | | |
12 | 13 | | |
13 | 14 | | |
| |||
919 | 920 | | |
920 | 921 | | |
921 | 922 | | |
| 923 | + | |
| 924 | + | |
| 925 | + | |
| 926 | + | |
| 927 | + | |
| 928 | + | |
| 929 | + | |
| 930 | + | |
| 931 | + | |
| 932 | + | |
| 933 | + | |
| 934 | + | |
| 935 | + | |
| 936 | + | |
| 937 | + | |
| 938 | + | |
| 939 | + | |
| 940 | + | |
| 941 | + | |
| 942 | + | |
| 943 | + | |
| 944 | + | |
| 945 | + | |
| 946 | + | |
| 947 | + | |
| 948 | + | |
| 949 | + | |
922 | 950 | | |
923 | 951 | | |
924 | 952 | | |
| |||
0 commit comments