Skip to main content

set_compress_min_depth

Function set_compress_min_depth 

Source
pub fn set_compress_min_depth(depth: u8)
Expand description

Set the youngest generational depth whose spilled bodies are compressed.

A chunk at depth d is rewritten (merged, extracted, advanced) with frequency proportional to 2^-d under geometric merging, so compressing a shallow chunk buys a short stay in the pool at the cost of a guaranteed near-term codec round-trip: the body is encoded only to be read back and decoded by the next rewrite. Generations below the floor spill under the identity codec instead: still budgeted and swap-backed like every extent, but encode and decode are copies. The floor never exempts a body from the pool, so it cannot grow unbudgeted resident state.

The floor cannot strand a long-lived body uncompressed: a chunk that a merge carries forward untouched also ages a generation, and its body is re-spilled under the compressing codec when it crosses the floor (see survive_merge).

0 compresses every spilled body. Consulted at every commit, so changes apply to running dataflows.