Skip to main content

STATS_THRESHOLD

Constant STATS_THRESHOLD 

Source
const STATS_THRESHOLD: usize = _; // 65_536usize
Expand description

Number of pushes a from-scratch container observes before it turns its gathered stats into a safe codec.

A safe codec has at most 256 - SAFE_TAG_BASE (= 134) dictionary slots per column, so we only need to identify ~134 genuinely-popular values. The MisraGries summary retains up to 2 * k (= 1024) distinct candidates between tidies and reduces to k (= 512), comfortably more than 134, so the threshold just needs to be large enough that heavy hitters accumulate counts well above 1 before we freeze the codec. 64Ki pushes gives that headroom while keeping the pre-codec (uncompressed) window short.