Skip to content

perf(precompute): index oldest-series eviction - #601

Merged
zzylol merged 1 commit into
mainfrom
perf/592-indexed-series-eviction
Sep 4, 2026
Merged

zzylol merged 1 commit into
mainfrom
perf/592-indexed-series-eviction

Conversation

@zzylol

@zzylol zzylol commented Sep 4, 2026

Copy link
Copy Markdown
Contributor

Closes #592.

Replaces the O(MaxSeries) map scan with a deterministic min-heap keyed by (LastSeenMs, seriesKey). Admissions and recency updates are O(log N), while eviction is O(log N).

Also centralizes eviction cleanup: cached snapshots are removed and sketches are returned to the configured pool (or reset when no sink exists). Scalar, keyed, and envelope admissions maintain the same index.

Adds a cap-churn benchmark at 1k/10k/100k series. On the review host, 50-iteration samples were ~1.6µs/~2.8µs/~3.8µs per eviction with constant 304 B/op, instead of a linear full-map scan.

Stacked on #600.

@zzylol
zzylol force-pushed the fix/596-generation-safe-activation branch from c0cac2b to afae724 Compare September 4, 2026 12:08
@zzylol
zzylol force-pushed the perf/592-indexed-series-eviction branch from c82593c to 2c7ed60 Compare September 4, 2026 12:08
@zzylol
zzylol force-pushed the fix/596-generation-safe-activation branch from afae724 to 6ec19d3 Compare September 4, 2026 12:09
@zzylol
zzylol force-pushed the perf/592-indexed-series-eviction branch from 2c7ed60 to a00f09d Compare September 4, 2026 12:09
@zzylol
zzylol changed the base branch from fix/596-generation-safe-activation to main September 4, 2026 12:35
@zzylol
zzylol merged commit deeface into main Sep 4, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

asap-precompute-go: remove O(MaxSeries) eviction scan from the observation hot path

1 participant