You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Avoid flattening remembered-set chunks into a temporary array during collection #201
In GlobalAllocator::Collect, the generational path creates a local QuickVec<Object*> rememberedSet and calls sGlobalChunks.copyPointers. That helper first counts the entries, resizes the temporary native array, then copies every pointer out of the MarkChunk list. Collect then walks the copied array once to set each referrer's mark byte. The temporary array has no later use and is destroyed at the end of Collect.
This adds a native allocation, a full pointer copy and extra passes inside the stop-the-world phase. The work repeats each collection when there are remembered referrers. This is a source-level performance candidate at checkout 03a4e8d; no pause reduction has been measured yet.
Consider applying the mark-byte patch directly while walking the chunks, avoiding the flattened array. Preserve both current modes: a minor collection leaves the chunks available for remembered-set marking, while a full collection returns them to the free list. The traversal must not free a chunk before consuming its pointers or disturb the list used by the subsequent mark phase.
Measure large old-to-young reference sets, small sets and empty sets. Record setup/patch time, total pauses, native allocation count and remembered pointer count. Include thread detach handing back a partially filled chunk, transitions between full and generational modes, and verifier builds. Require the existing generational stress and soak coverage before adopting it, especially while #168 remains unresolved.
If direct traversal complicates the lifecycle, retaining bounded scratch capacity is an alternative to repeated allocation, but it would still copy every pointer and needs a retention limit after unusually large collections.
Related: #151 for phase-aware benchmarks. This targets temporary remembered-set flattening, not the correctness of write barriers or thread handoff.
Activity
Mark the remembered set without copying it
Mark the remembered set without copying it
Mark the remembered set without copying it