defaultCheckpointInterval top-level constant
int
const defaultCheckpointInterval
Default number of turns between full-state checkpoints.
Chosen to favor the common chat workload, where per-turn state is small and
read cost dominates. Per-save reconstruction reads grow ~linearly with the
interval while checkpoint write/storage cost shrinks with it, so the op-cost
optimum is roughly sqrt(6 * checkpointShardCount) (small for tiny state);
25 sits near that optimum for chat while staying conservative for larger
states. Raise it (e.g. 50-100) for large per-turn state retained long-term;
lower it (e.g. 10) for small-state, read-heavy sessions.
Implementation
const int defaultCheckpointInterval = 25;