Skip to content

bench(parquet): cover mask-backed intersection/union in row_selector - #10574

Merged
alamb merged 2 commits into
apache:mainfrom
haohuaijin:bench-mask-backed-selection-algebra
Aug 7, 2026
Merged

bench(parquet): cover mask-backed intersection/union in row_selector#10574
alamb merged 2 commits into
apache:mainfrom
haohuaijin:bench-mask-backed-selection-algebra

Conversation

@haohuaijin

Copy link
Copy Markdown
Contributor

Which issue does this PR close?

Split out of #10446 so that CI can compare both sides — the benchmark is new there, so the merge-base has nothing to compare against and the main column comes out empty.

Rationale for this change

row_selector.rs already benchmarks intersection/union, but it builds the operands with from_filters, which is selector-backed. Those take the RowSelector merge path and never reach the bitwise one used when both operands are mask-backed.

What changes are included in this PR?

Adds mask_intersection/mask_union, varying the two dimensions that drive the bitwise path:

  • the ratio between operand lengths, since unequal lengths pass the longer side's tail through unchanged
  • the bit offsets the operands carry, since masks come from BooleanBuffer::slice and whether the two share a sub-64-bit alignment decides which path the underlying helpers take

Benchmark only, no library changes.

Are these changes tested?

N/A — this is a benchmark. It builds and runs on main as-is.

Are there any user-facing changes?

No.

The existing `intersection`/`union` benchmarks build their operands with
`from_filters`, which is selector-backed, so they take the `RowSelector` merge
path and never reach the bitwise one.

Add `mask_intersection`/`mask_union` alongside them, varying two dimensions
that drive the bitwise path: the ratio between operand lengths, since the
longer side's tail passes through unchanged, and the bit offsets the operands
carry, since masks come from `BooleanBuffer::slice` and whether the two share
a sub-64-bit alignment decides which path the underlying helpers take.

@alamb alamb left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you @haohuaijin

@alamb
alamb merged commit 3e6bd62 into apache:main Aug 7, 2026
18 checks passed
@haohuaijin
haohuaijin deleted the bench-mask-backed-selection-algebra branch August 7, 2026 15:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

parquet Changes to the parquet crate

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants