IN LIST: reuse primitive filters for FixedSizeBinary - #24102
IN LIST: reuse primitive filters for FixedSizeBinary#24102geoffreyclaude wants to merge 2 commits into
Conversation
5f0e386 to
9915d25
Compare
9915d25 to
6f820d7
Compare
|
run benchmark in_list |
|
🤖 Benchmark running (GKE) | trigger CPU Details (lscpu)Comparing codex/in-list-fixed-size-binary-hashset (6f820d7) to b6cccfe diff Run configurationrun benchmark in_list
baseline:
ref: "b6cccfeef1a78ab424ffec87afb40958c33fb897"Results will be posted here when complete File an issue against this benchmark runner |
|
🤖 Benchmark completed (GKE) | trigger Instance: Comparing codex/in-list-fixed-size-binary-hashset (6f820d7) to b6cccfe diff Run configurationrun benchmark in_list
baseline:
ref: "b6cccfeef1a78ab424ffec87afb40958c33fb897"CPU Details (lscpu)Details
Resource Usagein_list — base (merge-base)
in_list — branch
File an issue against this benchmark runner |
|
run benchmark in_list_strategy |
|
🤖 Benchmark running (GKE) | trigger CPU Details (lscpu)Comparing codex/in-list-fixed-size-binary-hashset (6f820d7) to 426b351 (merge-base) diff Run configurationrun benchmark in_list_strategyResults will be posted here when complete File an issue against this benchmark runner |
|
🤖 Benchmark running (GKE) | trigger CPU Details (lscpu)Comparing codex/in-list-fixed-size-binary-hashset (6f820d7) to b6cccfe diff Run configurationrun benchmark in_list_strategy
baseline:
ref: "b6cccfeef1a78ab424ffec87afb40958c33fb897"Results will be posted here when complete File an issue against this benchmark runner |
|
🤖 Benchmark completed (GKE) | trigger Instance: Comparing codex/in-list-fixed-size-binary-hashset (6f820d7) to 426b351 (merge-base) diff Run configurationrun benchmark in_list_strategyCPU Details (lscpu)Details
Resource Usagein_list_strategy — base (merge-base)
in_list_strategy — branch
File an issue against this benchmark runner |
|
🤖 Benchmark completed (GKE) | trigger Instance: Comparing codex/in-list-fixed-size-binary-hashset (6f820d7) to b6cccfe diff Run configurationrun benchmark in_list_strategy
baseline:
ref: "b6cccfeef1a78ab424ffec87afb40958c33fb897"CPU Details (lscpu)Details
Resource Usagein_list_strategy — base (merge-base)
in_list_strategy — branch
File an issue against this benchmark runner |
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #24102 +/- ##
==========================================
- Coverage 80.91% 80.90% -0.02%
==========================================
Files 1102 1104 +2
Lines 377102 377534 +432
Branches 377102 377534 +432
==========================================
+ Hits 305143 305451 +308
- Misses 53769 53839 +70
- Partials 18190 18244 +54 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Which issue does this PR close?
main.INperformance with specialized implementations #19390.Rationale for this change
FixedSizeBinary(1),(2),(4),(8), and(16)values occupy fixed-width buffer slots matching native integer widths. Reinterpreting each slot as an equal-width primitive is a bijection over its byte pattern, so equality and hashing preserve opaque byte equality.This lets
IN LISTuse the same strategies that are effective for primitives: bitmap membership for widths 1 and 2, and branchless comparisons or standard hash lookup for widths 4, 8, and 16.What changes are included in this PR?
HashSet, keyed by the exact native-width representation, for larger lists.read_unaligned.FixedSizeBinaryarrays with the exact configured width.ArrayStaticFilter; wrong-width or custom needles return errors.InListExprevaluation.Are these changes tested?
Yes.
cargo fmt --allcargo test -p datafusion-physical-expr --lib expressions::in_list(76 passed)cargo clippy -p datafusion-physical-expr --all-targets --all-features -- -D warningsRUST_BACKTRACE=1 cargo test --profile ci --exclude datafusion-examples --exclude datafusion-benchmarks --exclude datafusion-cli --workspace --lib --tests --bins --features avro,json,backtrace,extended_tests,recursive_protection,parquet_encryptionThe full-workspace
cargo clippy --all-targets --all-features -- -D warningscurrently stops on an existing Rust 1.97uninlined_format_argswarning in generateddatafusion/proto-common/src/generated/pbjson.rs, unchanged from the comparedmaincommit. Strict Clippy for the modified package passes.Are there any user-facing changes?
No. This is an internal performance optimization only.
Local benchmark snapshot
Built and run in separate target directories after other compilation completed, using identical benchmark source in both revisions and filtering to the fixed-size binary rows:
Method: Criterion defaults (3-second warm-up, 5-second measurement, 100 samples), comparing median point estimates. Filter construction remains outside the timed loop. Lower is better; changes within +/-5% are treated as noise.
Compared baselines:
mainat426b351513-> this PRRelevant scope:
FixedSizeBinary(1),(2), and(16)rows across bitmap, branchless, and standardHashSetpaths.Summary: 12 relevant rows, 12 faster, 0 slower, 0 within +/-5%. Geometric-mean time decreased by 72.9%.
By path, geometric-mean time decreased by 91.6% for bitmap rows, 67.7% for branchless rows, and 44.2% for standard
HashSetrows. Miss-only rows decreased by 63.9%; 50%-hit rows decreased by 79.6%.fixed_size_binary/fsb1/list=16/match=0%fixed_size_binary/fsb1/list=16/match=50%fixed_size_binary/fsb2/list=64/match=0%fixed_size_binary/fsb2/list=64/match=50%fixed_size_binary/fsb16/list=4/match=0%fixed_size_binary/fsb16/list=4/match=50%fixed_size_binary/fsb16/list=64/match=0%fixed_size_binary/fsb16/list=64/match=50%fixed_size_binary/fsb16/list=256/match=0%fixed_size_binary/fsb16/list=256/match=50%fixed_size_binary/fsb16/list=10000/match=0%fixed_size_binary/fsb16/list=10000/match=50%