-
-
Notifications
You must be signed in to change notification settings - Fork 155
perf(gc): nursery cap + scavenge on by default — peak RSS -69% #7377
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
Merged
Merged
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,36 @@ | ||
| ### Changed | ||
|
|
||
| - **Peak RSS drops ~69%.** The 16 MB nursery cap and the evacuating scavenge are | ||
| now on by default; `PERRY_GC_SCAVENGE=0` reverts both for bisection. | ||
|
|
||
| Neither is worth shipping alone, which is why they go together. Measured as a | ||
| 2×2 over the 8 `gc_ratchet` probes: | ||
|
|
||
| | | no scavenge | scavenge | | ||
| |---|---:|---:| | ||
| | **no cap** | baseline | +0% RSS, +2% wall | | ||
| | **cap 16 MB** | −33% RSS, **+23% wall** | **−69% RSS, +3% wall** | | ||
|
|
||
| Scavenge alone moves nothing. The cap alone trades a third of the footprint | ||
| for a quarter of the wall time. Together the cap makes collections frequent | ||
| and scavenge makes them *evacuating* (O(live) copying) rather than O(heap) | ||
| sweeps, so the frequency is cheap: **799,604,736 → 245,055,488 bytes at +2% | ||
| wall**, all 8 probes byte-identical to Node. | ||
|
Comment on lines
+9
to
+18
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win Use one wall-time result. The table reports 🤖 Prompt for AI Agents |
||
|
|
||
| #7056 measured this and recommended "decouple the cap and keep it" — but the | ||
| cap was gated behind two knobs that both defaulted **off**, so it had never | ||
| been active in a shipped build, and acting on that recommendation literally | ||
| ships the −33%/+23% arm. | ||
|
|
||
| Enabling scavenge also defers alloc-point collections to a precise safepoint | ||
| rather than collecting behind a forced conservative scan. That became | ||
| reasonable only when #7370 made native roots the default. | ||
|
|
||
| - **`force_legacy_gc_pacing()` now pins all three pacing knobs.** It set only the | ||
| moving-loop-polls flag, which used to be sufficient because the cap and the | ||
| deferral branch both hung off it. With the cap unconditional and scavenge | ||
| default-on, the guard silently stopped pinning anything — that alone accounted | ||
| for 10 of the 23 `gc::` test failures this change first produced. The | ||
| remaining 13 were tests that drive the budgeted/incremental stepper without | ||
| the guard at all; they now pin it explicitly, since the shipped default | ||
| bypasses that path by design. | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win
Correct the rollback description.
PERRY_GC_SCAVENGE=0disables scavenging only.effective_next_arena_trigger()still applies the nursery cap in production. Do not state that this setting reverts both controls.🤖 Prompt for AI Agents