Skip to main content

SNAPSHOT_WAL_BYTES

Constant SNAPSHOT_WAL_BYTES 

Source
pub const SNAPSHOT_WAL_BYTES: u64 = _; // 4_194_304u64
Expand description

WAL bytes past the last snapshot that make writing a new one worthwhile.

Every open reads wal.bin whole and replays it frame by frame, so the tail is paid again on every hook, every MCP start and every CLI call — while a snapshot is paid once by the run that writes it. Measured on this repository, an 8.1 MB tail costs 156 ms per open against ~440 ms to snapshot it away, so a tail this size pays its snapshot back within three opens. Below the threshold the replay is cheap enough that snapshotting on every incremental run would cost more than it saves.