Skip to main content

compute_compaction_hints

Function compute_compaction_hints 

Source
pub fn compute_compaction_hints(
    messages: &[SavedMessage],
    recency_threshold: usize,
) -> Vec<CompactionHint>
Expand description

Compute compaction hints for a list of saved messages.

A simple recency heuristic: messages older than (total - recency_threshold) are marked compressible. The threshold is configurable; default is 2 (the most recent 2 turns are preserved).