Skip to content

perf(compaction): compute survivor minimum once - #1820

Draft
fallintoplace wants to merge 1 commit into
apache:mainfrom
fallintoplace:perf/compaction-survivor-minimum
Draft

perf(compaction): compute survivor minimum once#1820
fallintoplace wants to merge 1 commit into
apache:mainfrom
fallintoplace:perf/compaction-survivor-minimum

Conversation

@fallintoplace

@fallintoplace fallintoplace commented Aug 13, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Compute the survivor minimum sequence once per decision.
  • Avoid repeating the partition-minimum scan for every equality-delete candidate.
  • Work changes from O(P x D) to O(P + D).
  • Add a scaling benchmark.

Benchmark

Apple M1 Pro, arm64. 1,000 partitions and 1,000 equality-delete candidates:

Before After
Time 14.999 ms/op 65.7 us/op
Bytes 25,223,048 B/op 96,144 B/op
Allocs 9,006 allocs/op 15 allocs/op

That is about 228x faster, with 99.6% fewer bytes and 99.8% fewer allocations.

At 10,000 partitions and 1,000 candidates, time drops from 149.7 ms/op to 254 us/op.

Tests

  • go test ./...
  • go vet .

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