Repository navigation
Commit 72f191f
committed
Avoid repeated member lookup during full property enumeration
Full enumeration was repeating name lookups and base traversal that lazy
resolution needs but enumeration has already done. This overhead
appeared in the MUI and Webpack regressions after unified resolution.
Preserve its selective-lookup symbol and heap savings without paying the
same lookup costs while collecting all properties.
Six fresh-process interleaved production CLI comparisons against
5f35280, with normal GC and default threading, reduce instructions
2.55% on CI-pinned MUI and 2.17% on Xstate. Webpack and VS Code
instruction differences are inconclusive. Allocations decrease on all
four workloads.
Reported heap is unchanged except for a 0.12% increase on Xstate.
Against main aa81492, the combined branch uses 9.74-15.75% fewer
instructions and 23.11-31.55% less reported heap across these workloads.
These comparisons include all earlier optimizations on the branch.
MUI uses source and dependencies from the benchmark's CI-pinned commit
6780195595c12252a130aa5ae5c5bd461229c6b7. Webpack is isolated at
2289141381f2c1c965cb65118fa0ffe2e9e19834 with scenario dependencies
restored. VS Code uses 8bf178e1e1c2be3723f14683f7b1e5fdb3f780e4.
Xstate uses cc087bf52cbe5cc291146816e7ef530bc53698a0 and its existing
partial dependency installation. Existing workload diagnostics match
exactly across main, before, and after; candidate semantic counts match
before, including symbol counts.
MUI check time improves 10.85% in these samples, but the shared host is
noisy. No check-time difference against main is significant. This is not
evidence that the hosted CI timing regression has been eliminated.
heap-B/op is CLI-reported heap, not a forced-GC retained-heap measure.
Cached and uncached declared/inherited enumeration, identity, ordering,
negative lookups, unaffected snapshots, renamed keys, and diamond bases
pass focused tests with race/checkptr. npx hereby validate --all passes,
including 166161 Go tests and 954 API tests.
Before and after this change:
│ before.txt │ after.txt │
│ instructions/op │ instructions/op vs base │
mui-pinned-20 293.6G ± 2% 286.1G ± 2% -2.55% (p=0.002 n=6)
webpack-20 53.35G ± 2% 52.12G ± 3% ~ (p=0.065 n=6)
xstate-20 20.56G ± 2% 20.11G ± 1% -2.17% (p=0.015 n=6)
vscode-20 300.9G ± 5% 301.5G ± 3% ~ (p=1.000 n=6)
geomean 99.21G 97.52G -1.71%
│ before.txt │ after.txt │
│ heap-B/op │ heap-B/op vs base │
mui-pinned-20 2.061Gi ± 0% 2.061Gi ± 0% ~ (p=0.394 n=6)
webpack-20 666.6Mi ± 0% 666.7Mi ± 0% ~ (p=0.240 n=6)
xstate-20 274.9Mi ± 0% 275.3Mi ± 0% +0.12% (p=0.002 n=6)
vscode-20 2.834Gi ± 0% 2.833Gi ± 0% ~ (p=0.485 n=6)
geomean 1.005Gi 1.005Gi +0.02%
│ before.txt │ after.txt │
│ allocs/op │ allocs/op vs base │
mui-pinned-20 29.96M ± 0% 29.86M ± 0% -0.34% (p=0.026 n=6)
webpack-20 6.287M ± 0% 6.238M ± 0% -0.78% (p=0.002 n=6)
xstate-20 3.394M ± 0% 3.371M ± 0% -0.68% (p=0.002 n=6)
vscode-20 36.92M ± 0% 36.67M ± 0% -0.68% (p=0.002 n=6)
geomean 12.39M 12.32M -0.62%
│ before.txt │ after.txt │
│ check-sec/op │ check-sec/op vs base │
mui-pinned-20 10.155 ± 27% 9.053 ± 12% -10.85% (p=0.041 n=6)
webpack-20 1.844 ± 9% 1.743 ± 12% ~ (p=0.258 n=6)
xstate-20 915.5m ± 9% 926.0m ± 9% ~ (p=1.000 n=6)
vscode-20 7.689 ± 5% 7.549 ± 14% ~ (p=0.818 n=6)
geomean 3.388 3.240 -4.36%
│ main.txt │ after.txt │
│ instructions/op │ instructions/op vs base │
mui-pinned-20 317.0G ± 6% 286.1G ± 2% -9.74% (p=0.002 n=6)
webpack-20 58.36G ± 9% 52.12G ± 3% -10.68% (p=0.002 n=6)
xstate-20 23.45G ± 8% 20.11G ± 1% -14.23% (p=0.002 n=6)
vscode-20 357.8G ± 10% 301.5G ± 3% -15.75% (p=0.002 n=6)
geomean 111.6G 97.52G -12.63%
│ main.txt │ after.txt │
│ heap-B/op │ heap-B/op vs base │
mui-pinned-20 2.680Gi ± 0% 2.061Gi ± 0% -23.11% (p=0.002 n=6)
webpack-20 915.2Mi ± 0% 666.7Mi ± 0% -27.15% (p=0.002 n=6)
xstate-20 393.7Mi ± 0% 275.3Mi ± 0% -30.09% (p=0.002 n=6)
vscode-20 4.138Gi ± 0% 2.833Gi ± 0% -31.55% (p=0.002 n=6)
geomean 1.397Gi 1.005Gi -28.05%
│ main.txt │ after.txt │
│ allocs/op │ allocs/op vs base │
mui-pinned-20 32.84M ± 0% 29.86M ± 0% -9.07% (p=0.002 n=6)
webpack-20 6.586M ± 0% 6.238M ± 0% -5.29% (p=0.002 n=6)
xstate-20 3.804M ± 0% 3.371M ± 0% -11.39% (p=0.002 n=6)
vscode-20 36.87M ± 0% 36.67M ± 0% -0.57% (p=0.002 n=6)
geomean 13.20M 12.32M -6.67%
│ main.txt │ after.txt │
│ check-sec/op │ check-sec/op vs base │
mui-pinned-20 9.032 ± 13% 9.053 ± 12% ~ (p=1.000 n=6)
webpack-20 1.740 ± 8% 1.743 ± 12% ~ (p=1.000 n=6)
xstate-20 985.5m ± 18% 926.0m ± 9% ~ (p=0.180 n=6)
vscode-20 8.076 ± 10% 7.549 ± 14% ~ (p=0.240 n=6)
geomean 3.344 3.240 -3.09%1 parent 5f35280 commit 72f191f
2 files changed
Lines changed: 116 additions & 7 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
19691 | 19691 | | |
19692 | 19692 | | |
19693 | 19693 | | |
19694 | | - | |
19695 | | - | |
19696 | | - | |
| 19694 | + | |
19697 | 19695 | | |
19698 | 19696 | | |
19699 | 19697 | | |
| |||
19732 | 19730 | | |
19733 | 19731 | | |
19734 | 19732 | | |
| 19733 | + | |
| 19734 | + | |
| 19735 | + | |
| 19736 | + | |
| 19737 | + | |
| 19738 | + | |
| 19739 | + | |
| 19740 | + | |
| 19741 | + | |
19735 | 19742 | | |
19736 | 19743 | | |
19737 | 19744 | | |
| |||
19764 | 19771 | | |
19765 | 19772 | | |
19766 | 19773 | | |
| 19774 | + | |
| 19775 | + | |
| 19776 | + | |
| 19777 | + | |
| 19778 | + | |
| 19779 | + | |
| 19780 | + | |
| 19781 | + | |
| 19782 | + | |
| 19783 | + | |
| 19784 | + | |
| 19785 | + | |
| 19786 | + | |
| 19787 | + | |
| 19788 | + | |
| 19789 | + | |
| 19790 | + | |
| 19791 | + | |
| 19792 | + | |
| 19793 | + | |
| 19794 | + | |
| 19795 | + | |
| 19796 | + | |
19767 | 19797 | | |
19768 | 19798 | | |
19769 | 19799 | | |
19770 | 19800 | | |
19771 | 19801 | | |
19772 | 19802 | | |
19773 | | - | |
19774 | | - | |
| 19803 | + | |
| 19804 | + | |
| 19805 | + | |
| 19806 | + | |
| 19807 | + | |
| 19808 | + | |
| 19809 | + | |
| 19810 | + | |
| 19811 | + | |
19775 | 19812 | | |
19776 | 19813 | | |
19777 | | - | |
19778 | | - | |
| 19814 | + | |
| 19815 | + | |
| 19816 | + | |
| 19817 | + | |
| 19818 | + | |
| 19819 | + | |
| 19820 | + | |
| 19821 | + | |
| 19822 | + | |
| 19823 | + | |
| 19824 | + | |
| 19825 | + | |
| 19826 | + | |
| 19827 | + | |
| 19828 | + | |
| 19829 | + | |
19779 | 19830 | | |
19780 | 19831 | | |
19781 | 19832 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
253 | 253 | | |
254 | 254 | | |
255 | 255 | | |
| 256 | + | |
| 257 | + | |
| 258 | + | |
| 259 | + | |
| 260 | + | |
| 261 | + | |
| 262 | + | |
| 263 | + | |
| 264 | + | |
| 265 | + | |
| 266 | + | |
| 267 | + | |
| 268 | + | |
| 269 | + | |
| 270 | + | |
| 271 | + | |
| 272 | + | |
| 273 | + | |
| 274 | + | |
| 275 | + | |
| 276 | + | |
| 277 | + | |
| 278 | + | |
| 279 | + | |
| 280 | + | |
| 281 | + | |
| 282 | + | |
| 283 | + | |
| 284 | + | |
| 285 | + | |
| 286 | + | |
| 287 | + | |
| 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 | + | |
256 | 314 | | |
257 | 315 | | |
258 | 316 | | |
| |||
0 commit comments