Parent: #97 Related: #62, zig-utils/zig-gc#4
Evidence
The exact shared-realm object_churn profile attributed 216 of 994 coordinator evaluation samples to GcCellBacking.trimEmptyTailChunks. The old path filtered the intrusive free list node by node, including every slot in tail chunks that were immediately returned. Bootstrap cells leave a small live size-class prefix, so the optimized path reconstructs the list from issued slots in the bounded retained prefix instead.
Rejected exact-parent experiments are recorded in the issue timeline: deferring nursery trimming changed reuse behavior, while only fast-clearing completely empty buckets missed the measured live-prefix case.
Acceptance criteria
- Tail trimming work is bounded by retained issued slots rather than discarded free slots.
- Fully empty buckets clear their all-free list in O(1).
- Partially live buckets retain exactly their valid free nodes and existing reusable-tail behavior.
- Preserve capacity, issued/free/live counters, ownership indexes, and allocator delegation.
- Materially improve the exact shared row without regressing direct throughput.
- Pass focused allocator/GC/no-GIL tests and the batched unit/TSan gates.
- Update the benchmark report, raw evidence, README, and benchmark guide.
Implementation: c98a36c
Publication: e4b7240
Report: https://github.com/zig-utils/zig-js/blob/main/docs/.data/benchmark-comparison-2026-07-14.md
Raw evidence: https://github.com/zig-utils/zig-js/blob/main/docs/.data/benchmark-comparison-2026-07-14.tsv