Skip to main content

STASH_CAP

Constant STASH_CAP 

Source
const STASH_CAP: usize = 2;
Expand description

Max recycled empty chunks held in the per-batcher stash. Deliberately tight: the stash is a hot-buffer cache for the result/keep/ship churn, not a hoard. Stash entries are cleared Column::Typed allocations that retain capacity but are not tracked by ColumnPager’s ResidentTicket accounting, so each one is a chunk’s worth of resident bytes the pager’s budget doesn’t see. There’s one stash per arrange batcher per worker, so this multiplies fast.

2 covers steady-state reuse for both code paths: merge_chains ships result and immediately pulls a refill; extract_chain ships keep / ship and pulls a refill for whichever was at capacity. Heads that drain mid-loop arrive resident from FetchIter, so the whole-chunk passthrough fast path keeps most of them off the merge inner loop entirely — only a small minority ever flow back through the stash.