perf(arrow): build constant filter masks with BooleanBuffer instead of Vec<bool> - #3177
Open
anoopj wants to merge 1 commit into
Open
perf(arrow): build constant filter masks with BooleanBuffer instead of Vec<bool>#3177anoopj wants to merge 1 commit into
anoopj wants to merge 1 commit into
Conversation
…f Vec<bool> The predicate converter builds all-true and all-false boolean masks with BooleanArray::from(vec![b; n]), which allocates an n-byte Vec<bool> and then bit-packs it into the array. BooleanBuffer::new_set/new_unset write the packed bits directly, skipping the throwaway Vec and the pack pass. Covers the always-true/false predicates and the initial accumulators for is_in / not_in, built once per batch. Output is identical (all-set/all-unset, no nulls). Isolated construction is ~200x faster at 8192 rows; the real per-batch win is smaller since this is a fraction of filter evaluation.
anoopj
force-pushed
the
perf-predicate-boolean-buffer
branch
from
September 8, 2026 15:07
275042b to
0b4a5f8
Compare
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 changes are included in this PR?
The predicate converter builds all-true and all-false boolean masks with BooleanArray::from(vec![b; n]), which allocates an n-byte Vec and then bit-packs it into the array. BooleanBuffer::new_set/new_unset write the packed bits directly, skipping the throwaway Vec and the pack pass.
Covers the always-true/false predicates and the initial accumulators for is_in / not_in, built once per batch. Output is identical (all-set/all-unset, no nulls). Isolated construction is ~200x faster at 8192 rows; the real per-batch win is smaller since this is a fraction of filter evaluation.
Are these changes tested?
Covered by existing tests