IN LIST: reuse primitive filters for FixedSizeBinary - #23018
IN LIST: reuse primitive filters for FixedSizeBinary#23018geoffreyclaude wants to merge 3 commits into
Conversation
70c420f to
098e0a6
Compare
|
run benchmark in_list_strategy |
|
🤖 Benchmark running (GKE) | trigger CPU Details (lscpu)Comparing perf/in_list_fixed_size_binary_filter (098e0a6) to c7e9284 (merge-base) diff using: in_list_strategy File an issue against this benchmark runner |
|
🤖 Benchmark completed (GKE) | trigger Instance: CPU Details (lscpu)Details
Resource Usagein_list_strategy — base (merge-base)
in_list_strategy — branch
File an issue against this benchmark runner |
|
run benchmark in_list |
|
🤖 Benchmark running (GKE) | trigger CPU Details (lscpu)Comparing perf/in_list_fixed_size_binary_filter (098e0a6) to c7e9284 (merge-base) diff using: in_list File an issue against this benchmark runner |
|
🤖 Benchmark completed (GKE) | trigger Instance: CPU Details (lscpu)Details
Resource Usagein_list — base (merge-base)
in_list — branch
File an issue against this benchmark runner |
098e0a6 to
ce699c4
Compare
2e036e0 to
e49202b
Compare
ade2587 to
397944d
Compare
0b737f4 to
49ed00e
Compare
49ed00e to
e9cef90
Compare
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #23018 +/- ##
==========================================
+ Coverage 80.89% 80.91% +0.02%
==========================================
Files 1102 1105 +3
Lines 376093 377186 +1093
Branches 376093 377186 +1093
==========================================
+ Hits 304239 305200 +961
- Misses 53748 53773 +25
- Partials 18106 18213 +107 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
e9cef90 to
821e2d7
Compare
821e2d7 to
f69d4c0
Compare
Which issue does this PR close?
INperformance with specialized implementations #19390.Rationale for this change
FixedSizeBinary(1),(2),(4),(8), and(16)values have the same fixed-width buffer shape as the primitive representations already optimized in this stack. Native equality and hashing preserve opaque byte equality, so these arrays can reuse the existing filters through a narrow representation adapter.What changes are included in this PR?
PrimitiveFrozenFilterfor larger lists.FixedSizeBinary(16)rather than broadening general Decimal128 routing.read_unaligned.ArrayStaticFilter; wrong-width or custom needles return errors rather than panicking.Are these changes tested?
Yes. Coverage includes every supported width, both sides of each branchless/FrozenSet boundary, slices, dictionaries,
IN/NOT IN, nulls, empty and all-null lists, duplicates, the FrozenSet sentinel member, unsupported/custom arrays, aligned zero-copy conversion, unaligned buffers, and end-to-endInListExprevaluation.cargo fmt --allcargo test -p datafusion-physical-expr --lib expressions::in_listcargo clippy --all-targets --all-features -- -D warnings./dev/rust_lint.shRUST_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_encryptionAre there any user-facing changes?
No. This is an internal performance optimization only.
Local benchmark snapshot
Built and run in separate target directories with identical benchmark source, filtered to the relevant fixed-size binary rows:
Method: directly compared Criterion median point estimates. Expression construction remains outside the timed loop. Lower is better; changes within +/-5% are treated as noise.
Compared baselines: #23016 -> #23018
Relevant scope:
FixedSizeBinary(1),(2),(4),(8), and(16)across bitmap, branchless, and FrozenSet paths.Summary: 20 relevant rows, 20 faster, 0 slower, 0 within +/-5%. Geometric-mean time decreased by 80.7%.
By path, geometric-mean time decreased by 90.8% for bitmap rows, 87.4% for branchless rows, and 66.5% for FrozenSet rows. Miss-only rows decreased by 68.7%; 50%-hit rows decreased by 88.2%.
Largest relevant deltas:
fixed_size_binary/fsb4/list=4/match=50%fixed_size_binary/fsb8/list=4/match=50%fixed_size_binary/fsb2/list=64/match=50%fixed_size_binary/fsb1/list=16/match=50%fixed_size_binary/fsb4/list=4/match=0%fixed_size_binary/fsb8/list=4/match=0%fixed_size_binary/fsb2/list=64/match=0%fixed_size_binary/fsb1/list=16/match=0%fixed_size_binary/fsb4/list=64/match=50%fixed_size_binary/fsb16/list=4/match=50%Full relevant table (20 rows)
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/fsb4/list=4/match=0%fixed_size_binary/fsb4/list=4/match=50%fixed_size_binary/fsb4/list=64/match=0%fixed_size_binary/fsb4/list=64/match=50%fixed_size_binary/fsb8/list=4/match=0%fixed_size_binary/fsb8/list=4/match=50%fixed_size_binary/fsb8/list=64/match=0%fixed_size_binary/fsb8/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%