perf(gc): reduce retained arena RSS and redundant GC work - #11781
Conversation
|
Important Review skippedToo many files! This PR contains 493 files, which is 193 over the limit of 300. To get a review, reduce the PR to 300 files or fewer by splitting it into smaller PRs or changing its base branch. Usage-priced reviews support at most 300 files. ⚙️ Run configuration
⛔ Files ignored due to path filters (1)
📒 Files selected for processing (493)
You can disable this status message by setting the
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Review: #11781 at
|
2396510 to
07079e0
Compare
9e4cbac to
56cc90b
Compare
9c9e599 to
41e68ed
Compare
Reduce peak RSS of GC-enabled compiled programs by compacting persistent old-page metadata (104→56 bytes per page plus shared chunks), releasing cold owned arena pages while preserving recent reuse, and avoiding redundant GC bookkeeping. Lazy malloc membership and epoch/generation checks remove work without changing collection thresholds, object headers, shapes, or the ABI. Stream hidden-key caches use fast TLS and retain their registered GC root scanner.
Matched measurements against main
ad0a2617bf0b9708032cf89c86575e9bd69fb074: 17 workloads, 204 correct executions, three RSS and three instruction samples per arm. TypeScript peak RSS −4.74% (instructions +0.41%); trees −11.67% (instructions −0.40%); Zod −0.26% (instructions −0.05%). Every RSS median improved except unchanged noop. Full signed results, distributions, source/product hashes and verification scripts are indocs/audits/gc-rss-instructions-2026-10-03.Validation of the measured GC source: Linux runtime 4867 passed; macOS 4881 passed; five ignored on each. Moving/protected linked coverage has 22 executions, including 11 with actual moving collections. Linux and macOS each pass 15 event tests, 75 FFI tests and doc tests. The landing tree rebases onto main
0a5bb47dc5, adds the TLS gate fix and patch version 0.5.1657; fresh final-tree build, runtime/stdlib/integration suites and the complete lint/check tier are running in an isolated checkout on the build server. Prior app measurements remain bound to their measured commits.Pending-mark-frontier, RSS query sampling, learned nursery-floor and native-prefix experiments are excluded. Class-value root scanning belongs to Claude's
perf-class-value-scanlane. GC pacing, conservative scanning (#11873) and incremental correctness (#11842) are follow-up work, not claims of this PR. Twelve blank lines are removed from the inherited 2008-line object module solely to satisfy the file-size gate; no object-model behavior changes.