Skip to content

perf(table): index snapshot removals with a set - #1802

Draft
fallintoplace wants to merge 1 commit into
apache:mainfrom
fallintoplace:perf/index-snapshot-removals
Draft

perf(table): index snapshot removals with a set#1802
fallintoplace wants to merge 1 commit into
apache:mainfrom
fallintoplace:perf/index-snapshot-removals

Conversation

@fallintoplace

@fallintoplace fallintoplace commented Aug 13, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Build one snapshot ID set in MetadataBuilder.RemoveSnapshots.
  • Reuse it for the current snapshot guard and snapshot, log, statistics, and partition statistics filters.
  • Replace repeated linear membership scans with map lookups while keeping the update payload and behavior unchanged.

Performance

In a microbenchmark on an Apple M1 Pro with 1,000 snapshot/log/statistics entries and 500 IDs to remove:

  • Before: ~660 us/op
  • After: ~63 us/op
  • About 10.5x faster

The set allocation scales with the number of IDs being removed.

Tests

  • go test ./table -run TestRemoveSnapshots|TestMetadataBuilder -count=1
  • go test ./table -count=1

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