Skip to content

perf(arrow): build constant filter masks with BooleanBuffer instead of Vec<bool> - #3177

Open
anoopj wants to merge 1 commit into
apache:mainfrom
anoopj:perf-predicate-boolean-buffer
Open

perf(arrow): build constant filter masks with BooleanBuffer instead of Vec<bool>#3177
anoopj wants to merge 1 commit into
apache:mainfrom
anoopj:perf-predicate-boolean-buffer

Conversation

@anoopj

@anoopj anoopj commented Sep 8, 2026

Copy link
Copy Markdown
Member

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

…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.
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