Skip to content

Optimize Int8 and Int16 integer IN filters#23299

Merged
alamb merged 4 commits into
apache:mainfrom
alamb:codex/in-list-direct-bitmap-filter
Jul 3, 2026
Merged

Optimize Int8 and Int16 integer IN filters#23299
alamb merged 4 commits into
apache:mainfrom
alamb:codex/in-list-direct-bitmap-filter

Conversation

@alamb

@alamb alamb commented Jul 2, 2026

Copy link
Copy Markdown
Contributor

Which issue does this PR close?

Rationale for this change

This is an alternate implementation proposal for optimizing small integer IN list from @geoffreyclaude

The in #23013 does some shenangans, including rebuilding the Arrow array data directly in order to probe a bitmap keyed by an unsigned type. Handling signed small integer types directly keeps the implementation simpler and avoids the extra array-data path while preserving the compact bitmap representation for these small domains.

What changes are included in this PR?

This updates the specialized IN list bitmap filter to handle Int8, UInt8, Int16, and UInt16 directly.

Signed small integer filters now map values to bitmap indexes by their bit pattern, so negative values use the same compact bitmap domain as their unsigned counterparts.

Are these changes tested?

Yes. This adds coverage for signed Int8 and Int16 bitmap filters, including boundary values and sliced arrays.

Are there any user-facing changes?

No. This is an internal physical expression optimization for small integer IN list filters.

@github-actions github-actions Bot added the physical-expr Changes to the physical-expr crates label Jul 2, 2026
@alamb alamb changed the title Optimize small integer IN bitmap filters Optimize Int8 and Int16 integer IN filters Jul 2, 2026
@alamb alamb force-pushed the codex/in-list-direct-bitmap-filter branch from d99ae33 to 5141088 Compare July 2, 2026 21:51
@alamb

alamb commented Jul 2, 2026

Copy link
Copy Markdown
Contributor Author

run benchmark in_list_strategy

@alamb alamb marked this pull request as ready for review July 2, 2026 21:51
@adriangbot

Copy link
Copy Markdown

🤖 Benchmark running (GKE) | trigger
Instance: c4a-highmem-16 (12 vCPU / 65 GiB) | Linux bench-c4870763465-814-4m9fg 6.12.85+ #1 SMP Mon May 11 08:17:35 UTC 2026 aarch64 GNU/Linux

CPU Details (lscpu)
Architecture:                            aarch64
CPU op-mode(s):                          64-bit
Byte Order:                              Little Endian
CPU(s):                                  16
On-line CPU(s) list:                     0-15
Vendor ID:                               ARM
Model name:                              Neoverse-V2
Model:                                   1
Thread(s) per core:                      1
Core(s) per cluster:                     16
Socket(s):                               -
Cluster(s):                              1
Stepping:                                r0p1
BogoMIPS:                                2000.00
Flags:                                   fp asimd evtstrm aes pmull sha1 sha2 crc32 atomics fphp asimdhp cpuid asimdrdm jscvt fcma lrcpc dcpop sha3 sm3 sm4 asimddp sha512 sve asimdfhm dit uscat ilrcpc flagm sb paca pacg dcpodp sve2 sveaes svepmull svebitperm svesha3 svesm4 flagm2 frint svei8mm svebf16 i8mm bf16 dgh rng bti
L1d cache:                               1 MiB (16 instances)
L1i cache:                               1 MiB (16 instances)
L2 cache:                                32 MiB (16 instances)
L3 cache:                                80 MiB (1 instance)
NUMA node(s):                            1
NUMA node0 CPU(s):                       0-15
Vulnerability Gather data sampling:      Not affected
Vulnerability Indirect target selection: Not affected
Vulnerability Itlb multihit:             Not affected
Vulnerability L1tf:                      Not affected
Vulnerability Mds:                       Not affected
Vulnerability Meltdown:                  Not affected
Vulnerability Mmio stale data:           Not affected
Vulnerability Reg file data sampling:    Not affected
Vulnerability Retbleed:                  Not affected
Vulnerability Spec rstack overflow:      Not affected
Vulnerability Spec store bypass:         Mitigation; Speculative Store Bypass disabled via prctl
Vulnerability Spectre v1:                Mitigation; __user pointer sanitization
Vulnerability Spectre v2:                Mitigation; CSV2, BHB
Vulnerability Srbds:                     Not affected
Vulnerability Tsa:                       Not affected
Vulnerability Tsx async abort:           Not affected
Vulnerability Vmscape:                   Not affected

Comparing codex/in-list-direct-bitmap-filter (5141088) to 01bf68c (merge-base) diff using: in_list_strategy
Results will be posted here when complete


File an issue against this benchmark runner


#[inline(always)]
fn index(value: Self::Native) -> usize {
value as u16 as usize

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

the idea is just to reinterpret the signed value into a usize

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.

I think this is good as an comment within the code

@alamb alamb Jul 3, 2026

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Good idea -- done in 90bf7cc

@alamb alamb requested a review from kosiew July 2, 2026 21:57
@adriangbot

Copy link
Copy Markdown

🤖 Benchmark completed (GKE) | trigger

Instance: c4a-highmem-16 (12 vCPU / 65 GiB)

CPU Details (lscpu)
Architecture:                            aarch64
CPU op-mode(s):                          64-bit
Byte Order:                              Little Endian
CPU(s):                                  16
On-line CPU(s) list:                     0-15
Vendor ID:                               ARM
Model name:                              Neoverse-V2
Model:                                   1
Thread(s) per core:                      1
Core(s) per cluster:                     16
Socket(s):                               -
Cluster(s):                              1
Stepping:                                r0p1
BogoMIPS:                                2000.00
Flags:                                   fp asimd evtstrm aes pmull sha1 sha2 crc32 atomics fphp asimdhp cpuid asimdrdm jscvt fcma lrcpc dcpop sha3 sm3 sm4 asimddp sha512 sve asimdfhm dit uscat ilrcpc flagm sb paca pacg dcpodp sve2 sveaes svepmull svebitperm svesha3 svesm4 flagm2 frint svei8mm svebf16 i8mm bf16 dgh rng bti
L1d cache:                               1 MiB (16 instances)
L1i cache:                               1 MiB (16 instances)
L2 cache:                                32 MiB (16 instances)
L3 cache:                                80 MiB (1 instance)
NUMA node(s):                            1
NUMA node0 CPU(s):                       0-15
Vulnerability Gather data sampling:      Not affected
Vulnerability Indirect target selection: Not affected
Vulnerability Itlb multihit:             Not affected
Vulnerability L1tf:                      Not affected
Vulnerability Mds:                       Not affected
Vulnerability Meltdown:                  Not affected
Vulnerability Mmio stale data:           Not affected
Vulnerability Reg file data sampling:    Not affected
Vulnerability Retbleed:                  Not affected
Vulnerability Spec rstack overflow:      Not affected
Vulnerability Spec store bypass:         Mitigation; Speculative Store Bypass disabled via prctl
Vulnerability Spectre v1:                Mitigation; __user pointer sanitization
Vulnerability Spectre v2:                Mitigation; CSV2, BHB
Vulnerability Srbds:                     Not affected
Vulnerability Tsa:                       Not affected
Vulnerability Tsx async abort:           Not affected
Vulnerability Vmscape:                   Not affected
Details

group                                                                HEAD                                   codex_in-list-direct-bitmap-filter
-----                                                                ----                                   ----------------------------------
dictionary/i32/dict=10/list=16                                       1.00      7.6±0.03µs        ? ?/sec    1.00      7.6±0.01µs        ? ?/sec
dictionary/i32/dict=100/list=16                                      1.00      7.7±0.00µs        ? ?/sec    1.00      7.7±0.01µs        ? ?/sec
dictionary/i32/dict=100/list=16/NOT_IN                               1.00      7.7±0.03µs        ? ?/sec    1.00      7.7±0.02µs        ? ?/sec
dictionary/i32/dict=100/list=4                                       1.00      7.7±0.02µs        ? ?/sec    1.00      7.7±0.01µs        ? ?/sec
dictionary/i32/dict=100/list=64                                      1.00      7.7±0.00µs        ? ?/sec    1.00      7.8±0.01µs        ? ?/sec
dictionary/i32/dict=1000/list=16                                     1.00      9.0±0.01µs        ? ?/sec    1.00      9.0±0.01µs        ? ?/sec
dictionary/utf8_long/dict=100/list=16                                1.00      8.3±0.01µs        ? ?/sec    1.00      8.3±0.01µs        ? ?/sec
dictionary/utf8_short/dict=50/list=32                                1.00      8.1±0.01µs        ? ?/sec    1.00      8.1±0.01µs        ? ?/sec
dictionary/utf8_short/dict=50/list=8                                 1.00      8.0±0.02µs        ? ?/sec    1.00      8.0±0.01µs        ? ?/sec
dictionary/utf8_short/dict=500/list=20                               1.00      9.5±0.01µs        ? ?/sec    1.01      9.6±0.01µs        ? ?/sec
f32/large_list/list=64/match=0%                                      1.01     15.5±0.04µs        ? ?/sec    1.00     15.5±0.02µs        ? ?/sec
f32/large_list/list=64/match=50%                                     1.19     26.1±0.42µs        ? ?/sec    1.00     22.0±0.36µs        ? ?/sec
f32/small_list/list=32/match=0%                                      1.00     15.5±0.01µs        ? ?/sec    1.00     15.5±0.01µs        ? ?/sec
f32/small_list/list=32/match=50%                                     1.00     27.4±0.32µs        ? ?/sec    1.01     27.7±0.33µs        ? ?/sec
f32/small_list/list=4/match=0%                                       1.01     15.4±0.06µs        ? ?/sec    1.00     15.3±0.01µs        ? ?/sec
f32/small_list/list=4/match=50%                                      1.01     28.0±0.38µs        ? ?/sec    1.00     27.7±0.23µs        ? ?/sec
fixed_size_binary/fsb16/list=10000/match=0%                          1.00     24.9±0.20µs        ? ?/sec    1.03     25.6±0.02µs        ? ?/sec
fixed_size_binary/fsb16/list=10000/match=50%                         1.02     56.7±0.36µs        ? ?/sec    1.00     55.7±0.24µs        ? ?/sec
fixed_size_binary/fsb16/list=256/match=0%                            1.00     22.9±0.08µs        ? ?/sec    1.05     23.9±0.05µs        ? ?/sec
fixed_size_binary/fsb16/list=256/match=50%                           1.04     51.7±0.20µs        ? ?/sec    1.00     49.7±0.53µs        ? ?/sec
fixed_size_binary/fsb16/list=4/match=0%                              1.00     22.0±0.03µs        ? ?/sec    1.04     22.9±0.02µs        ? ?/sec
fixed_size_binary/fsb16/list=4/match=50%                             1.01     55.8±0.21µs        ? ?/sec    1.00     55.5±0.39µs        ? ?/sec
fixed_size_binary/fsb16/list=64/match=0%                             1.00     22.0±0.03µs        ? ?/sec    1.04     22.9±0.02µs        ? ?/sec
fixed_size_binary/fsb16/list=64/match=50%                            1.00     55.7±0.22µs        ? ?/sec    1.01     56.0±0.27µs        ? ?/sec
narrow_integer/i16/list=256/match=0%                                 2.39     12.5±0.01µs        ? ?/sec    1.00      5.2±0.00µs        ? ?/sec
narrow_integer/i16/list=256/match=50%                                3.38     17.7±0.17µs        ? ?/sec    1.00      5.2±0.00µs        ? ?/sec
narrow_integer/i16/list=4/match=0%                                   2.42     12.7±0.06µs        ? ?/sec    1.00      5.2±0.00µs        ? ?/sec
narrow_integer/i16/list=4/match=50%                                  4.39     22.9±0.24µs        ? ?/sec    1.00      5.2±0.00µs        ? ?/sec
narrow_integer/i16/list=64/match=0%                                  2.34     12.3±0.03µs        ? ?/sec    1.00      5.3±0.00µs        ? ?/sec
narrow_integer/i16/list=64/match=50%                                 3.58     18.8±0.21µs        ? ?/sec    1.00      5.2±0.00µs        ? ?/sec
narrow_integer/u8/list=16/match=0%                                   1.00      5.2±0.01µs        ? ?/sec    1.00      5.2±0.00µs        ? ?/sec
narrow_integer/u8/list=16/match=50%                                  1.00      5.2±0.00µs        ? ?/sec    1.00      5.2±0.00µs        ? ?/sec
narrow_integer/u8/list=4/match=0%                                    1.00      5.2±0.00µs        ? ?/sec    1.00      5.2±0.01µs        ? ?/sec
narrow_integer/u8/list=4/match=50%                                   1.00      5.2±0.00µs        ? ?/sec    1.00      5.2±0.01µs        ? ?/sec
nulls/narrow_integer/u8/list=16/match=50%/nulls=20%                  1.00      5.3±0.00µs        ? ?/sec    1.00      5.3±0.00µs        ? ?/sec
nulls/primitive/i32/large_list/list=64/match=50%/nulls=20%           1.05     16.9±0.15µs        ? ?/sec    1.00     16.1±0.14µs        ? ?/sec
nulls/primitive/i32/small_list/list=16/match=50%/nulls=20%           1.03     22.8±0.26µs        ? ?/sec    1.00     22.2±0.14µs        ? ?/sec
nulls/primitive/i32/small_list/list=16/match=50%/nulls=20%/NOT_IN    1.23     23.7±0.18µs        ? ?/sec    1.00     19.3±0.20µs        ? ?/sec
nulls/primitive/i32/small_list/list=16/match=50%/nulls=50%           1.04     16.5±0.08µs        ? ?/sec    1.00     15.9±0.16µs        ? ?/sec
nulls/utf8/long_24b/list=16/match=50%/nulls=20%                      1.01     71.4±0.24µs        ? ?/sec    1.00     70.4±0.23µs        ? ?/sec
nulls/utf8/short_8b/list=16/match=50%/nulls=20%                      1.03     63.3±0.68µs        ? ?/sec    1.00     61.7±0.35µs        ? ?/sec
nulls/utf8view/long_24b/list=16/match=50%/nulls=20%                  1.01     79.8±0.51µs        ? ?/sec    1.00     78.8±0.20µs        ? ?/sec
nulls/utf8view/short_8b/list=16/match=50%/nulls=20%                  1.20     49.2±0.18µs        ? ?/sec    1.00     41.0±0.14µs        ? ?/sec
nulls/utf8view/short_8b/list=16/match=50%/nulls=20%/NOT_IN           1.19     49.2±0.28µs        ? ?/sec    1.00     41.5±0.23µs        ? ?/sec
nulls/utf8view/short_8b/list=16/match=50%/nulls=50%                  1.49     43.6±0.29µs        ? ?/sec    1.00     29.3±0.07µs        ? ?/sec
primitive/i32/large_list/list=256/match=0%                           1.00     12.2±0.03µs        ? ?/sec    1.00     12.2±0.03µs        ? ?/sec
primitive/i32/large_list/list=256/match=50%                          1.00     19.3±0.13µs        ? ?/sec    1.00     19.4±0.13µs        ? ?/sec
primitive/i32/large_list/list=64/match=0%                            1.00     12.3±0.01µs        ? ?/sec    1.02     12.6±0.02µs        ? ?/sec
primitive/i32/large_list/list=64/match=50%                           1.25     23.2±0.49µs        ? ?/sec    1.00     18.5±0.14µs        ? ?/sec
primitive/i32/small_list/list=16/match=50%/NOT_IN                    1.00     24.5±0.38µs        ? ?/sec    1.00     24.6±0.38µs        ? ?/sec
primitive/i32/small_list/list=32/match=0%                            1.00     12.0±0.07µs        ? ?/sec    1.00     12.1±0.01µs        ? ?/sec
primitive/i32/small_list/list=32/match=50%                           1.03     22.6±0.36µs        ? ?/sec    1.00     22.0±0.25µs        ? ?/sec
primitive/i32/small_list/list=4/match=0%                             1.01     12.0±0.01µs        ? ?/sec    1.00     11.9±0.01µs        ? ?/sec
primitive/i32/small_list/list=4/match=50%                            1.04     23.8±1.12µs        ? ?/sec    1.00     22.8±0.24µs        ? ?/sec
primitive/i64/large_list/list=128/match=0%                           1.09     13.0±0.03µs        ? ?/sec    1.00     12.0±0.02µs        ? ?/sec
primitive/i64/large_list/list=128/match=50%                          1.00     21.7±0.21µs        ? ?/sec    1.09     23.6±0.23µs        ? ?/sec
primitive/i64/large_list/list=32/match=0%                            1.00     11.8±0.01µs        ? ?/sec    1.03     12.1±0.01µs        ? ?/sec
primitive/i64/large_list/list=32/match=50%                           1.00     19.3±0.13µs        ? ?/sec    1.25     24.0±0.21µs        ? ?/sec
primitive/i64/small_list/list=16/match=0%                            1.00     12.0±0.01µs        ? ?/sec    1.13     13.6±0.02µs        ? ?/sec
primitive/i64/small_list/list=16/match=50%                           1.00     24.0±0.17µs        ? ?/sec    1.15     27.7±0.22µs        ? ?/sec
primitive/i64/small_list/list=4/match=0%                             1.00     12.2±0.07µs        ? ?/sec    1.00     12.2±0.01µs        ? ?/sec
primitive/i64/small_list/list=4/match=50%                            1.00     23.2±0.25µs        ? ?/sec    1.14     26.4±0.18µs        ? ?/sec
timestamp_ns/large_list/list=32/match=0%                             1.00     16.1±0.04µs        ? ?/sec    1.07     17.2±0.02µs        ? ?/sec
timestamp_ns/large_list/list=32/match=50%                            1.00     33.2±0.50µs        ? ?/sec    1.00     33.3±0.26µs        ? ?/sec
timestamp_ns/small_list/list=16/match=0%                             1.00     16.1±0.02µs        ? ?/sec    1.07     17.2±0.01µs        ? ?/sec
timestamp_ns/small_list/list=16/match=50%                            1.04     37.3±1.29µs        ? ?/sec    1.00     36.0±0.51µs        ? ?/sec
timestamp_ns/small_list/list=4/match=0%                              1.00     16.0±0.04µs        ? ?/sec    1.07     17.1±0.04µs        ? ?/sec
timestamp_ns/small_list/list=4/match=50%                             1.00     32.3±0.31µs        ? ?/sec    1.00     32.2±0.28µs        ? ?/sec
utf8/long_24b/list=256/match=0%                                      1.00     33.6±0.04µs        ? ?/sec    1.02     34.2±0.07µs        ? ?/sec
utf8/long_24b/list=256/match=50%                                     1.03     72.0±0.39µs        ? ?/sec    1.00     69.9±1.22µs        ? ?/sec
utf8/long_24b/list=4/match=0%                                        1.00     34.0±0.03µs        ? ?/sec    1.02     34.5±0.03µs        ? ?/sec
utf8/long_24b/list=4/match=50%                                       1.03     73.1±0.16µs        ? ?/sec    1.00     71.3±0.34µs        ? ?/sec
utf8/long_24b/list=64/match=0%                                       1.00     33.1±0.02µs        ? ?/sec    1.05     34.6±0.19µs        ? ?/sec
utf8/long_24b/list=64/match=50%                                      1.04     73.1±0.52µs        ? ?/sec    1.00     70.2±0.37µs        ? ?/sec
utf8/mixed_len/list=16/match=0%                                      1.01     34.9±0.08µs        ? ?/sec    1.00     34.6±0.12µs        ? ?/sec
utf8/mixed_len/list=16/match=50%                                     1.00     96.6±0.78µs        ? ?/sec    1.01     97.7±0.67µs        ? ?/sec
utf8/mixed_len/list=64/match=0%                                      1.00     37.0±0.31µs        ? ?/sec    1.03     38.1±0.29µs        ? ?/sec
utf8/mixed_len/list=64/match=50%                                     1.00    101.8±0.61µs        ? ?/sec    1.03    104.3±1.13µs        ? ?/sec
utf8/shared_prefix/pfx=12/list=32/match=50%                          1.01     72.2±0.50µs        ? ?/sec    1.00     71.5±0.40µs        ? ?/sec
utf8/short_8b/list=16/match=50%/NOT_IN                               1.00     65.8±0.64µs        ? ?/sec    1.01     66.4±1.11µs        ? ?/sec
utf8/short_8b/list=256/match=0%                                      1.00     25.6±0.03µs        ? ?/sec    1.04     26.5±0.03µs        ? ?/sec
utf8/short_8b/list=256/match=50%                                     1.01     65.7±0.63µs        ? ?/sec    1.00     65.3±0.37µs        ? ?/sec
utf8/short_8b/list=4/match=0%                                        1.00     25.8±0.04µs        ? ?/sec    1.03     26.6±0.09µs        ? ?/sec
utf8/short_8b/list=4/match=50%                                       1.00     65.2±0.22µs        ? ?/sec    1.00     65.5±1.00µs        ? ?/sec
utf8/short_8b/list=64/match=0%                                       1.00     25.6±0.02µs        ? ?/sec    1.04     26.6±0.04µs        ? ?/sec
utf8/short_8b/list=64/match=50%                                      1.01     65.9±0.31µs        ? ?/sec    1.00     65.1±0.52µs        ? ?/sec
utf8view/len_12b/list=16/match=0%                                    1.00     16.8±0.02µs        ? ?/sec    1.06     17.8±0.02µs        ? ?/sec
utf8view/len_12b/list=16/match=50%                                   1.00     45.8±0.21µs        ? ?/sec    1.03     47.2±0.19µs        ? ?/sec
utf8view/len_12b/list=64/match=0%                                    1.00     17.0±0.03µs        ? ?/sec    1.05     17.8±0.02µs        ? ?/sec
utf8view/len_12b/list=64/match=50%                                   1.00     45.4±0.21µs        ? ?/sec    1.02     46.2±0.21µs        ? ?/sec
utf8view/long_24b/list=16/match=0%                                   1.00     39.0±0.03µs        ? ?/sec    1.03     40.2±0.14µs        ? ?/sec
utf8view/long_24b/list=16/match=50%                                  1.00     87.0±0.19µs        ? ?/sec    1.00     87.3±0.24µs        ? ?/sec
utf8view/long_24b/list=256/match=0%                                  1.00     39.0±0.03µs        ? ?/sec    1.03     40.2±0.02µs        ? ?/sec
utf8view/long_24b/list=256/match=50%                                 1.00     85.9±0.30µs        ? ?/sec    1.00     86.0±0.20µs        ? ?/sec
utf8view/long_24b/list=4/match=0%                                    1.00     39.0±0.04µs        ? ?/sec    1.03     40.2±0.04µs        ? ?/sec
utf8view/long_24b/list=4/match=50%                                   1.00     87.0±0.20µs        ? ?/sec    1.01     87.7±0.18µs        ? ?/sec
utf8view/long_24b/list=64/match=0%                                   1.00     39.3±0.17µs        ? ?/sec    1.05     41.2±0.38µs        ? ?/sec
utf8view/long_24b/list=64/match=50%                                  1.00     85.0±0.36µs        ? ?/sec    1.00     85.1±0.34µs        ? ?/sec
utf8view/mixed_len/list=16/match=0%                                  1.00     28.9±0.08µs        ? ?/sec    1.14     33.0±0.11µs        ? ?/sec
utf8view/mixed_len/list=16/match=50%                                 1.00     65.5±0.27µs        ? ?/sec    1.17     76.9±0.49µs        ? ?/sec
utf8view/mixed_len/list=64/match=0%                                  1.00     33.2±0.16µs        ? ?/sec    1.00     33.1±0.08µs        ? ?/sec
utf8view/mixed_len/list=64/match=50%                                 1.00     80.6±0.43µs        ? ?/sec    1.08     87.4±0.87µs        ? ?/sec
utf8view/shared_prefix/pfx=12/list=32/match=0%                       1.00     40.5±0.03µs        ? ?/sec    1.04     42.1±0.06µs        ? ?/sec
utf8view/shared_prefix/pfx=12/list=32/match=50%                      1.00     86.1±0.49µs        ? ?/sec    1.00     85.8±0.37µs        ? ?/sec
utf8view/shared_prefix/pfx=16/list=64/match=0%                       1.00     38.7±0.05µs        ? ?/sec    1.05     40.7±0.50µs        ? ?/sec
utf8view/shared_prefix/pfx=16/list=64/match=50%                      1.00     85.3±0.38µs        ? ?/sec    1.00     85.6±0.30µs        ? ?/sec
utf8view/shared_prefix/pfx=8/list=16/match=0%                        1.00     28.4±0.06µs        ? ?/sec    1.06     30.0±0.14µs        ? ?/sec
utf8view/shared_prefix/pfx=8/list=16/match=50%                       1.01     72.1±0.27µs        ? ?/sec    1.00     71.3±0.32µs        ? ?/sec
utf8view/short_8b/list=16/match=0%                                   1.00     16.5±0.04µs        ? ?/sec    1.07     17.7±0.03µs        ? ?/sec
utf8view/short_8b/list=16/match=50%                                  1.01     41.6±0.20µs        ? ?/sec    1.00     41.4±0.17µs        ? ?/sec
utf8view/short_8b/list=256/match=0%                                  1.00     16.7±0.02µs        ? ?/sec    1.06     17.8±0.02µs        ? ?/sec
utf8view/short_8b/list=256/match=50%                                 1.00     41.5±0.13µs        ? ?/sec    1.00     41.6±0.28µs        ? ?/sec
utf8view/short_8b/list=4/match=0%                                    1.00     16.8±0.02µs        ? ?/sec    1.06     17.9±0.08µs        ? ?/sec
utf8view/short_8b/list=4/match=50%                                   1.00     44.4±0.25µs        ? ?/sec    1.04     46.0±0.28µs        ? ?/sec
utf8view/short_8b/list=64/match=0%                                   1.00     16.9±0.13µs        ? ?/sec    1.06     18.0±0.02µs        ? ?/sec
utf8view/short_8b/list=64/match=50%                                  1.01     40.9±0.18µs        ? ?/sec    1.00     40.7±0.20µs        ? ?/sec

Resource Usage

in_list_strategy — base (merge-base)

Metric Value
Wall time 1325.3s
Peak memory 41.7 MiB
Avg memory 28.6 MiB
CPU user 1406.7s
CPU sys 1.2s
Peak spill 0 B

in_list_strategy — branch

Metric Value
Wall time 1345.3s
Peak memory 42.2 MiB
Avg memory 28.3 MiB
CPU user 1418.8s
CPU sys 1.2s
Peak spill 0 B

File an issue against this benchmark runner

@alamb alamb added the performance Make DataFusion faster label Jul 3, 2026

@kosiew kosiew 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.

@alamb
Looks good to me.
Just one small follow-up suggestion for broader regression coverage.

}

#[test]
fn bitmap_filter_i8_handles_signed_boundaries_and_slices() -> Result<()> {

@kosiew kosiew Jul 3, 2026

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.

One small follow-up idea: it could be useful to add a public-path regression through InListExpr::try_new_from_array, or a SQL-level test, for Int8 and Int16 signed values.
That would cover the dispatch path in strategy.rs in addition to the filter implementation itself.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

This is a good idea -- I reviewed the existing slt (SQL) test coverage and it doesn't really have comprensive IN list coverage -- I will add some in a follow on PR

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

@alamb

alamb commented Jul 3, 2026

Copy link
Copy Markdown
Contributor Author

Benchmarks look good

group                                                                HEAD                                   codex_in-list-direct-bitmap-filter
-----                                                                ----                                   ----------------------------------
narrow_integer/i16/list=256/match=0%                                 2.39     12.5±0.01µs        ? ?/sec    1.00      5.2±0.00µs        ? ?/sec
narrow_integer/i16/list=256/match=50%                                3.38     17.7±0.17µs        ? ?/sec    1.00      5.2±0.00µs        ? ?/sec
narrow_integer/i16/list=4/match=0%                                   2.42     12.7±0.06µs        ? ?/sec    1.00      5.2±0.00µs        ? ?/sec
narrow_integer/i16/list=4/match=50%                                  4.39     22.9±0.24µs        ? ?/sec    1.00      5.2±0.00µs        ? ?/sec
narrow_integer/i16/list=64/match=0%                                  2.34     12.3±0.03µs        ? ?/sec    1.00      5.3±0.00µs        ? ?/sec
narrow_integer/i16/list=64/match=50%                                 3.58     18.8±0.21µs        ? ?/sec    1.00      5.2±0.00µs        ? ?/sec
narrow_integer/u8/list=16/match=0%                                   1.00      5.2±0.01µs        ? ?/sec    1.00      5.2±0.00µs        ? ?/sec
narrow_integer/u8/list=16/match=50%                                  1.00      5.2±0.00µs        ? ?/sec    1.00      5.2±0.00µs        ? ?/sec
narrow_integer/u8/list=4/match=0%                                    1.00      5.2±0.00µs        ? ?/sec    1.00      5.2±0.01µs        ? ?/sec
narrow_integer/u8/list=4/match=50%                                   1.00      5.2±0.00µs        ? ?/sec    1.00      5.2±0.01µs        ? ?/sec

@alamb

alamb commented Jul 3, 2026

Copy link
Copy Markdown
Contributor Author

Per @geoffreyclaude in

I will address @kosiew 's comments and merge this PR so we can keep thigns moving

@geoffreyclaude geoffreyclaude 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.

LGTM as it keeps things focused on the current need: i8 and i16.

@alamb

alamb commented Jul 3, 2026

Copy link
Copy Markdown
Contributor Author

Ok, I think all the comments have been addressed, and we are working on SLT coverage in #23307

🚀

@alamb alamb added this pull request to the merge queue Jul 3, 2026
Merged via the queue into apache:main with commit 997b90a Jul 3, 2026
38 checks passed
@alamb alamb deleted the codex/in-list-direct-bitmap-filter branch July 3, 2026 14:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

performance Make DataFusion faster physical-expr Changes to the physical-expr crates

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants