Skip to content

perf(gc): the minor collector still does a full-region sweep walk over the old generation (#6181 sub-cost a) #7716

Description

@proggeramlug

The one unfixed sub-cost from #6181, refiled on its own so it stops sharing a ticket with two that are done.

Fixed and closed with #6181: (b) the whole-heap remembered-set rebuild and (c) the per-cycle page-meta iterations, via #6213 / #6277 / #6568.

Still live: sub-cost (a) — the minor collector performs a full-region sweep walk over the old generation. crates/perry-runtime/src/gc/oldgen.rs::sweep (line ~476) is reached on the minor path, so minor-GC cost scales with old-gen size rather than with nursery survivors — which is the property a generational collector exists to avoid.

Why this is worth doing and what to watch

The remembered set already exists precisely so a minor need not retrace the old generation, so the walk is redundant work on the hot path. But two things make this less mechanical than it looks:

Before coding

Re-measure. #6181's figures predate #6213/#6277/#6568, so the remaining share attributable to (a) alone has never been isolated. Use PERRY_GC_DIAG=1 and confirm the cycle KINDS you are measuring are the ones you think — census counters cover copying minors ONLY, and a run whose cycles are full mark-sweeps says nothing about the minor path.

Bench host per the standing rule: the quiet M1 mini.

Metadata

Metadata

Assignees

No one assigned

    Labels

    performanceRuntime, compile-time, build-size, or memory performance

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions