bench: add array_has array-needle benchmarks#23335
Merged
Merged
Conversation
Adds criterion benchmarks for `array_has` with an array (column) needle -- the path through `array_has_dispatch_for_array`: - `array_has_array_i64` / `array_has_array_strings`: found / not-found over list sizes 10/100/500. - `array_has_array_null_patterns`: null patterns at list length 64 (no nulls, 30% nulls found/not-found, all null, and a null-fill collision) for i64, and no-nulls / 30% nulls for each of the Utf8, LargeUtf8, and Utf8View string element types at both short (inline, <= 12 byte) and long (> 12 byte, shared-prefix) element lengths, plus all-null. - `array_has_array_by_size`: i64, 30% nulls, not found, list length 8..1024. - `array_has_array_by_rows`: i64, 8 elems/row, 30% nulls, not found, 10K..1M rows. Added ahead of the array-needle optimization (a separate PR) so the before/after can be measured by running `cargo bench --bench array_has` on `main` and then on the optimization branch. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This was referenced Jul 6, 2026
geoffreyclaude
approved these changes
Jul 6, 2026
Add `i64/no_nulls_not_found` to `array_has_array_null_patterns` -- the worst case for the all-valid fast path (non-null elements, needle absent), where the branchless OR-reduction scans the whole row without short-circuiting. Addresses review feedback on apache#23335. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
gabotechs
approved these changes
Jul 6, 2026
gabotechs
left a comment
Contributor
There was a problem hiding this comment.
💯 Thanks @freakyzoidberg for the PR, and @geoffreyclaude for the 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.
Which issue does this PR close?
array_haswhen the search element is a column #23334.Rationale for this change
In order to correctly characterize a performance improvement for array_has with column needle, needed more benchmark cover.
What changes are included in this PR?
Adds criterion benchmarks for
array_haswith an array (column) needle — the path througharray_has_dispatch_for_array, with no functional change.Groups added in
datafusion/functions-nested/benches/array_has.rs:array_has_array_i64/array_has_array_strings— found / not-found over list sizes 10/100/500.array_has_array_null_patterns— null patterns at list length 64: for i64, no nulls (found + not found) / 30% nulls found / 30% nulls not found / all null / null-fill collision; for Utf8, LargeUtf8, and Utf8View, no-nulls / 30% nulls at both short (inline, ≤ 12 byte) and long (> 12 byte, shared-prefix) element lengths, plus all-null.array_has_array_by_size— i64, 30% element nulls, not found, list length 8..1024.array_has_array_by_rows— i64, 8 elems/row, 30% nulls, not found, 10K / 100K / 1M rows.Are these changes tested?
no functional change here
Are there any user-facing changes?
no