Skip to content

perf(table): avoid quadratic snapshot-log pruning - #1801

Open
fallintoplace wants to merge 2 commits into
apache:mainfrom
fallintoplace:perf/snapshot-log-pruning
Open

perf(table): avoid quadratic snapshot-log pruning#1801
fallintoplace wants to merge 2 commits into
apache:mainfrom
fallintoplace:perf/snapshot-log-pruning

Conversation

@fallintoplace

@fallintoplace fallintoplace commented Aug 13, 2026

Copy link
Copy Markdown
Contributor

What changed

  • Build one snapshot-ID set in RemoveSnapshots.
  • Reuse it for snapshot, snapshot-log, statistics, and partition-statistics pruning.
  • Add a benchmark covering larger snapshot logs.

Benchmark

Same benchmark, 5 runs, 500 ms each, on an Apple M1 Pro:

  • 1,000 entries: ~167 µs -> ~15.7 µs, about 10x faster.
  • 10,000 entries: ~13.4 ms -> ~171 µs, about 78x faster.

The speedup comes from replacing repeated linear membership scans with map lookups.

@fallintoplace
fallintoplace marked this pull request as ready for review August 14, 2026 17:13
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.

1 participant