perf(manifest): update partition summaries incrementally - #1770
Merged
zeroshade merged 3 commits intoAug 17, 2026
Merged
Conversation
fallintoplace
force-pushed
the
perf/incremental-manifest-partition-summaries
branch
from
August 15, 2026 22:43
af7e223 to
6aee32c
Compare
fallintoplace
marked this pull request as ready for review
August 15, 2026 22:46
zeroshade
requested changes
Aug 17, 2026
Comment on lines
1270
to
1276
| var actualVal T | ||
| v := reflect.ValueOf(value) | ||
| if !v.CanConvert(reflect.TypeOf(actualVal)) { | ||
| return fmt.Errorf("expected type %T, got %T", actualVal, value) | ||
| } | ||
|
|
||
| actualVal = v.Convert(reflect.TypeOf(actualVal)).Interface().(T) |
Member
There was a problem hiding this comment.
instead of the clonePartitionStatValue function, should we just incorporate cloning the []byte slice into this piece of logic? That seems simpler and preferable
Contributor
Author
There was a problem hiding this comment.
Thanks. I simplified the update logic.
zeroshade
approved these changes
Aug 17, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
ToManifestFile, like beforeWhy
ManifestWritercurrently keeps one partition map per entry.ToManifestFilethen walks all of them again to build partition summaries.This makes retained state and finalization work grow with the number of manifest entries. The Java writer already keeps one
PartitionSummaryaccumulator and updates it for each entry.The summary values are unchanged. They still follow the spec rules for nulls, NaNs, and lower/upper bounds.
Benchmark
Median results on an Apple M1 Pro:
This benchmark isolates
ToManifestFileafter entries have already been written. End-to-end manifest writing is still mostly Avro encoding. At 10,000 entries, the end-to-end benchmark also reduced allocations from about 23.02 MB/op to 22.71 MB/op.Testing
go test ./...go test -race . -run '^(TestManifestWriterUpdatesPartitionSummariesIncrementally|TestConstructPartitionSummariesWithDroppedSource|TestManifests)$' -count=1go vet ./...