Skip to main content

Module tinylfu

Module tinylfu 

Source
Expand description

W-TinyLFU estimator + policies (filled in Stage B, Tasks 5-7).

Structs§

ProbationAdmission
Admits a first-ever miss into Probation; once the shared estimator has seen promotion_threshold prior sightings of a hash, admits straight to Main. Reads estimate only — never calls observe (see the ordering invariant in the module docs: a request must never count as evidence for its own promotion).
TinyLfuEstimator
Shared W-TinyLFU frequency evidence: one sighting per served request from the serve path, one estimate read per fill-path admission decision and per probation candidate at sweep time.
TinyLfuEviction
Ranks eviction candidates least-frequent-first, reading frequency from a shared estimator; ties break oldest-access-first (LRFU), then largest first, so blobs sharing the open-time recency seed release in the order that reaches the target in the fewest releases. Also owns the probation lifecycle at sweep time: promotes probation members whose buffered frequency has reached promotion_threshold, and caps probation’s footprint to probation_target_pct of cache_bytes by evicting the least-frequent non-promoted probation members first.