Skip to content

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

Merged
zeroshade merged 3 commits into
apache:mainfrom
fallintoplace:perf/compaction-survivor-minimum
Aug 17, 2026
Merged

perf(compaction): compute survivor minimum once#1820
zeroshade merged 3 commits 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 .

@zeroshade

Copy link
Copy Markdown
Member

Since this is a draft, i'll hold off on further review until it's marked ready

@fallintoplace
fallintoplace marked this pull request as ready for review August 17, 2026 21:27
@zeroshade
zeroshade merged commit 4390d2a into apache:main Aug 17, 2026
15 checks 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.

2 participants