perf(arrow/array): pack validity values in batches - #1185
Merged
zeroshade merged 1 commit intoAug 14, 2026
Conversation
fallintoplace
marked this pull request as draft
August 12, 2026 12:30
fallintoplace
force-pushed
the
perf/arrow-batch-validity-packing
branch
from
August 13, 2026 20:55
c92dd6c to
6fcea67
Compare
fallintoplace
marked this pull request as ready for review
August 13, 2026 20:56
zeroshade
approved these changes
Aug 14, 2026
zeroshade
left a comment
Member
There was a problem hiding this comment.
The batched packing logic checks out — prefix/tail bounds are right, the read-modify-write tail preserves neighboring bits, and null counting via popcount is correct. The exhaustive packValidityByte test and the poisoned-bitmap offset/length matrix give good confidence. Nice speedup.
Note: this will likely need a rebase against #1173/#1180 depending on merge order.
This review was drafted with the help of an AI-assisted tool and may contain mistakes; it was reviewed and confirmed by an Apache Arrow maintainer before posting. See the contributing guide for what the project considers a maintainer review.
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.
Rationale for this change
Appending an explicit
[]boolvalidity slice currently updates the bitmap and null count one value at a time. This is a noticeable part ofAppendValuesfor narrow types.What changes are included in this PR?
Benchmarks append 65,536 values on an Apple M1 Pro. Values are medians from three runs.
No allocations are added.
Are these changes tested?
Yes.
go test ./arrow/...go test -race ./arrow/arraygo vet ./arrow/arrayAre there any user-facing changes?
No. This only changes how builder validity bitmaps are populated.