Skip to content

Skip building the filter output null buffer when no selected row is null - #11257

Open
bharadwaj-pendyala wants to merge 7 commits into
apache:mainfrom
bharadwaj-pendyala:perf/filter-skip-all-valid-nulls
Open

bharadwaj-pendyala wants to merge 7 commits into
apache:mainfrom
bharadwaj-pendyala:perf/filter-skip-all-valid-nulls

Conversation

@bharadwaj-pendyala

@bharadwaj-pendyala bharadwaj-pendyala commented Sep 28, 2026 •

Copy link
Copy Markdown
Contributor

Which issue does this PR close?

Rationale for this change

When the input has nulls, FilterPredicate::filter_nulls always filters the validity into a new buffer and counts it, then drops the buffer if the count comes out zero. A filter that keeps no null rows, like x IS NOT NULL AND ..., pays for a bitmap it never uses.

What changes are included in this PR?

filter_nulls now asks selects_null first and returns None straight away when no selected row is null.

selects_null zips the 64-bit words of the mask and the validity and stops at the first word where keep & !valid is non-zero. It doesn't allocate, and it takes the offsets of both buffers into account. For an optimized Indices predicate below one selected row per word, it probes those indices instead. That's the crossover filter_bits already uses for sparse_indices. Without it, a 1/2048 filter scans all 1024 words to check 32 rows, and above that crossover the word scan wins. An early version probed indices for every Indices predicate and took 98 µs at kept 1/4 instead of 43 µs.

filter_nulls returns early for the None and All strategies before it calls selects_null, so those two don't pay for the scan. It checks that the null buffer covers the filter before the scan too. Without that check, the sparse index path would read only the selected rows and quietly return None.

Are these changes tested?

Yes, in arrow-select/src/filter.rs:

  • test_filter_nulls_selecting_only_valid_rows asserts selects_null is false and the filtered array has no null buffer.
  • test_filter_nulls_selecting_one_null asserts it's true when the only selected null is row 0 or 64 (full words) or row 199 (the partial last word).

Both run the lazy and optimized predicates, sliced and unsliced masks, over values sliced at offset 1. The masks land on both sides of FILTER_SLICES_SELECTIVITY_THRESHOLD, plus one sparse enough for the index probe. test_filter_nulls_too_large covers the length check on that sparse path.

Each of these edits turns at least one test red: dropping the trailing partial word, ignoring the null buffer's offset, ignoring the mask's offset, having the index probe return false, having selects_null return true (today's behaviour), and removing the assert.

cargo test -p arrow-select is 456 passed, 0 failed. cargo test -p parquet --features arrow --lib arrow::arrow_reader is 158 passed. cargo fmt --all -- --check and cargo clippy -p arrow-select --all-targets --all-features -- -D warnings are clean.

Benchmarks are the cases from #11256. I built two release binaries, main at fa337f8 and this branch, and ran them alternately. M1 laptop, criterion median, 3 rounds unless noted:

                                                          main            this PR
i32 w NULLs, only valid (kept 1/4)                        73-135 µs       42-43 µs
i32 w NULLs, only valid high sel. (kept 1023/2048)        147-222 µs      73-74 µs
i32 w NULLs, only valid low sel. (kept 1/2048)            1.10-1.13 µs    0.63-0.66 µs
i32 w NULLs at end (kept 1/2)                             219-222 µs      223-226 µs
i32 w NULLs at end high sel. (kept 1023/1024), 8 rounds   ~42 µs          ~45 µs
i32 w NULLs (kept 1/2), existing                          221-230 µs      221-223 µs
i32 w NULLs high sel. (kept 1023/1024), existing         43-51 µs        43 µs

The last two nulls-at-end rows are the cost. When the only selected null sits in the last word, the scan reads both bitmaps once before filter_bits reads them again, which comes to about 7% on the dense case on my M1. In the two GKE reruns on this PR (Neoverse-V2) it's 14-18%, 5.5-5.6 µs to 6.4 µs. With random nulls the scan stops in the first word, and the existing cases don't move beyond noise. Main swings a lot on the only-valid rows between runs, and this branch doesn't, so the low end of the main range is the fair comparison.

Are there any user-facing changes?

No API change. filter_nulls returns the same thing as before. A null buffer shorter than the filter that has any nulls still panics with assertion failed: nulls.len() >= self.filter.len(), same as before.

AI usage

Claude wrote the change, tests and benchmarks. Codex reviewed the diff adversarially twice before the push. The first pass flagged the index probe running for dense Indices predicates and the missing length check. The second pass flagged that the only-valid test would pass even if selects_null always returned true. I fixed all three and ran the edits above to check the tests catch them. I also measured every number here myself.

@github-actions github-actions Bot added arrow Changes to the arrow crate arrow-select labels Sep 28, 2026
@alamb

This comment has been minimized.

@adriangbot

This comment has been minimized.

@adriangbot

This comment has been minimized.

@bharadwaj-pendyala

Copy link
Copy Markdown
Contributor Author

The rows without nulls (decimal128, u8, and fsb without "w NULLs") return from filter_nulls on nulls? or null_count() == 0 before selects_null runs. So the 5 to 23% on those is code layout or runner noise, not the new scan. The same no-null path also moved the other way: filter context u8 (kept 1/2) is 14.0 µs on main and 12.1 µs here.

The cases this PR is for are the only-valid ones from #11256, which isn't merged yet, so this run can't show them.

@alamb

alamb commented Sep 30, 2026

Copy link
Copy Markdown
Contributor

Thanks @bharadwaj-pendyala -- I merged #11256 and will rerun the benchmarks

@alamb

This comment has been minimized.

1 similar comment
@alamb

This comment has been minimized.

@adriangbot

This comment was marked as duplicate.

@adriangbot

This comment was marked as duplicate.

@adriangbot

Copy link
Copy Markdown

🤖 Arrow criterion benchmark completed (GKE) | trigger

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

Comparing perf/filter-skip-all-valid-nulls (151769d) to 8c230e6 (merge-base) diff

Run configuration
run benchmark filter_kernels
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                                                                                main                                   perf_filter-skip-all-valid-nulls
-----                                                                                ----                                   --------------------------------
filter context decimal128 (kept 1/2)                                                 1.03     20.9±0.06µs        ? ?/sec    1.00     20.3±0.17µs        ? ?/sec
filter context decimal128 high selectivity (kept 1023/1024)                          1.00     19.3±0.19µs        ? ?/sec    1.00     19.4±0.15µs        ? ?/sec
filter context decimal128 low selectivity (kept 1/1024)                              1.00    146.1±0.92ns        ? ?/sec    1.01    147.6±0.69ns        ? ?/sec
filter context f32 (kept 1/2)                                                        1.01     42.0±0.05µs        ? ?/sec    1.00     41.7±0.16µs        ? ?/sec
filter context f32 high selectivity (kept 1023/1024)                                 1.06      5.8±0.01µs        ? ?/sec    1.00      5.4±0.01µs        ? ?/sec
filter context f32 low selectivity (kept 1/1024)                                     1.00    324.6±1.17ns        ? ?/sec    1.03    333.1±6.26ns        ? ?/sec
filter context fsb with value length 20 (kept 1/2)                                   1.00     45.5±0.11µs        ? ?/sec    1.01     46.0±0.15µs        ? ?/sec
filter context fsb with value length 20 high selectivity (kept 1023/1024)            1.01     24.8±0.55µs        ? ?/sec    1.00     24.6±0.28µs        ? ?/sec
filter context fsb with value length 20 low selectivity (kept 1/1024)                1.07    278.6±0.77ns        ? ?/sec    1.00    259.3±1.17ns        ? ?/sec
filter context fsb with value length 20 w NULLs (kept 1/2)                           1.00     75.9±0.17µs        ? ?/sec    1.01     76.9±0.17µs        ? ?/sec
filter context fsb with value length 20 w NULLs high selectivity (kept 1023/1024)    1.04     27.4±1.13µs        ? ?/sec    1.00     26.4±0.32µs        ? ?/sec
filter context fsb with value length 20 w NULLs low selectivity (kept 1/1024)        1.04    474.6±1.54ns        ? ?/sec    1.00    457.2±1.54ns        ? ?/sec
filter context fsb with value length 5 (kept 1/2)                                    1.00     44.3±0.02µs        ? ?/sec    1.00     44.2±0.02µs        ? ?/sec
filter context fsb with value length 5 high selectivity (kept 1023/1024)             1.02      4.8±0.01µs        ? ?/sec    1.00      4.7±0.00µs        ? ?/sec
filter context fsb with value length 5 low selectivity (kept 1/1024)                 1.01    229.1±2.84ns        ? ?/sec    1.00    226.1±2.55ns        ? ?/sec
filter context fsb with value length 5 w NULLs (kept 1/2)                            1.04     76.8±0.10µs        ? ?/sec    1.00     74.1±0.06µs        ? ?/sec
filter context fsb with value length 5 w NULLs high selectivity (kept 1023/1024)     1.01      6.6±0.02µs        ? ?/sec    1.00      6.6±0.01µs        ? ?/sec
filter context fsb with value length 5 w NULLs low selectivity (kept 1/1024)         1.00    412.6±4.46ns        ? ?/sec    1.00    412.3±3.48ns        ? ?/sec
filter context fsb with value length 50 (kept 1/2)                                   1.00     88.2±0.59µs        ? ?/sec    1.01     88.7±0.41µs        ? ?/sec
filter context fsb with value length 50 high selectivity (kept 1023/1024)            1.00     69.4±0.10µs        ? ?/sec    1.00     69.2±0.73µs        ? ?/sec
filter context fsb with value length 50 low selectivity (kept 1/1024)                1.08    314.7±0.93ns        ? ?/sec    1.00    292.3±0.85ns        ? ?/sec
filter context fsb with value length 50 w NULLs (kept 1/2)                           1.01    119.8±0.55µs        ? ?/sec    1.00    118.7±0.58µs        ? ?/sec
filter context fsb with value length 50 w NULLs high selectivity (kept 1023/1024)    1.00     66.7±0.22µs        ? ?/sec    1.01     67.4±2.48µs        ? ?/sec
filter context fsb with value length 50 w NULLs low selectivity (kept 1/1024)        1.05    503.0±0.77ns        ? ?/sec    1.00    480.5±1.50ns        ? ?/sec
filter context i32 (kept 1/2)                                                        1.10     13.5±0.41µs        ? ?/sec    1.00     12.3±0.01µs        ? ?/sec
filter context i32 high selectivity (kept 1023/1024)                                 1.01      3.7±0.00µs        ? ?/sec    1.00      3.7±0.01µs        ? ?/sec
filter context i32 low selectivity (kept 1/1024)                                     1.00    134.7±1.24ns        ? ?/sec    1.01    136.4±1.00ns        ? ?/sec
filter context i32 w NULLs (kept 1/2)                                                1.00     42.4±0.08µs        ? ?/sec    1.03     43.5±0.54µs        ? ?/sec
filter context i32 w NULLs at end (kept 1/2)                                         1.00     42.6±0.13µs        ? ?/sec    1.02     43.5±0.09µs        ? ?/sec
filter context i32 w NULLs at end high selectivity (kept 1023/1024)                  1.00      5.6±0.01µs        ? ?/sec    1.14      6.4±0.01µs        ? ?/sec
filter context i32 w NULLs high selectivity (kept 1023/1024)                         1.00      5.5±0.01µs        ? ?/sec    1.00      5.5±0.01µs        ? ?/sec
filter context i32 w NULLs low selectivity (kept 1/1024)                             1.00    330.3±1.25ns        ? ?/sec    1.00    329.1±4.11ns        ? ?/sec
filter context i32 w NULLs, only valid (kept 1/4)                                    2.64     19.6±0.09µs        ? ?/sec    1.00      7.4±0.01µs        ? ?/sec
filter context i32 w NULLs, only valid high selectivity (kept 1023/2048)             3.21     42.0±0.05µs        ? ?/sec    1.00     13.1±0.01µs        ? ?/sec
filter context i32 w NULLs, only valid low selectivity (kept 1/2048)                 1.76    227.9±0.70ns        ? ?/sec    1.00    129.4±0.33ns        ? ?/sec
filter context mixed string view (kept 1/2)                                          1.00     52.2±0.10µs        ? ?/sec    1.01     52.6±0.05µs        ? ?/sec
filter context mixed string view high selectivity (kept 1023/1024)                   1.00     21.7±0.13µs        ? ?/sec    1.00     21.7±0.16µs        ? ?/sec
filter context mixed string view low selectivity (kept 1/1024)                       1.01    323.3±2.92ns        ? ?/sec    1.00    321.6±2.17ns        ? ?/sec
filter context short string view (kept 1/2)                                          1.00     50.4±0.25µs        ? ?/sec    1.01     50.7±0.10µs        ? ?/sec
filter context short string view high selectivity (kept 1023/1024)                   1.00     21.9±0.12µs        ? ?/sec    1.00     21.9±0.13µs        ? ?/sec
filter context short string view low selectivity (kept 1/1024)                       1.00    323.2±3.10ns        ? ?/sec    1.02    330.4±3.11ns        ? ?/sec
filter context string (kept 1/2)                                                     1.00    384.6±1.22µs        ? ?/sec    1.00    382.9±1.67µs        ? ?/sec
filter context string dictionary (kept 1/2)                                          1.00     12.5±0.02µs        ? ?/sec    1.13     14.1±0.13µs        ? ?/sec
filter context string dictionary high selectivity (kept 1023/1024)                   1.00      3.7±0.01µs        ? ?/sec    1.00      3.7±0.01µs        ? ?/sec
filter context string dictionary low selectivity (kept 1/1024)                       1.00    196.9±1.05ns        ? ?/sec    1.01    198.5±1.62ns        ? ?/sec
filter context string dictionary w NULLs (kept 1/2)                                  1.01     43.8±1.31µs        ? ?/sec    1.00     43.6±0.82µs        ? ?/sec
filter context string dictionary w NULLs high selectivity (kept 1023/1024)           1.00      5.6±0.01µs        ? ?/sec    1.00      5.6±0.01µs        ? ?/sec
filter context string dictionary w NULLs low selectivity (kept 1/1024)               1.02    396.6±2.37ns        ? ?/sec    1.00    389.1±4.21ns        ? ?/sec
filter context string high selectivity (kept 1023/1024)                              1.01    318.1±1.86µs        ? ?/sec    1.00    315.5±1.03µs        ? ?/sec
filter context string low selectivity (kept 1/1024)                                  1.00    758.8±2.76ns        ? ?/sec    1.01    765.6±2.21ns        ? ?/sec
filter context u8 (kept 1/2)                                                         1.00     12.1±0.01µs        ? ?/sec    1.16     14.0±0.11µs        ? ?/sec
filter context u8 high selectivity (kept 1023/1024)                                  1.00   1047.1±2.82ns        ? ?/sec    1.02   1065.9±2.51ns        ? ?/sec
filter context u8 low selectivity (kept 1/1024)                                      1.00    124.1±1.07ns        ? ?/sec    1.03    127.7±0.41ns        ? ?/sec
filter context u8 w NULLs (kept 1/2)                                                 1.00     42.1±0.03µs        ? ?/sec    1.00     42.3±0.05µs        ? ?/sec
filter context u8 w NULLs high selectivity (kept 1023/1024)                          1.00      2.8±0.01µs        ? ?/sec    1.03      2.9±0.01µs        ? ?/sec
filter context u8 w NULLs low selectivity (kept 1/1024)                              1.00    307.9±0.96ns        ? ?/sec    1.01    309.8±4.25ns        ? ?/sec
filter decimal128 (kept 1/2)                                                         1.01     31.4±0.11µs        ? ?/sec    1.00     31.1±0.07µs        ? ?/sec
filter decimal128 high selectivity (kept 1023/1024)                                  1.02     20.7±0.08µs        ? ?/sec    1.00     20.3±0.12µs        ? ?/sec
filter decimal128 low selectivity (kept 1/1024)                                      1.02   1229.7±2.58ns        ? ?/sec    1.00   1209.5±1.72ns        ? ?/sec
filter f32 (kept 1/2)                                                                1.01     60.1±0.14µs        ? ?/sec    1.00     59.4±0.09µs        ? ?/sec
filter fsb with value length 20 (kept 1/2)                                           1.00     58.7±0.17µs        ? ?/sec    1.07     62.6±0.06µs        ? ?/sec
filter fsb with value length 20 high selectivity (kept 1023/1024)                    1.00     24.4±0.11µs        ? ?/sec    1.00     24.4±0.16µs        ? ?/sec
filter fsb with value length 20 low selectivity (kept 1/1024)                        1.01   1253.3±1.05ns        ? ?/sec    1.00   1235.9±3.98ns        ? ?/sec
filter fsb with value length 20 w NULLs (kept 1/2)                                   1.00     89.3±0.13µs        ? ?/sec    1.06     94.2±0.08µs        ? ?/sec
filter fsb with value length 20 w NULLs high selectivity (kept 1023/1024)            1.00     26.8±0.17µs        ? ?/sec    1.01     27.1±0.15µs        ? ?/sec
filter fsb with value length 20 w NULLs low selectivity (kept 1/1024)                1.00   1767.8±2.08ns        ? ?/sec    1.01   1791.7±4.84ns        ? ?/sec
filter fsb with value length 5 (kept 1/2)                                            1.00     55.8±0.04µs        ? ?/sec    1.09     60.9±0.03µs        ? ?/sec
filter fsb with value length 5 high selectivity (kept 1023/1024)                     1.02      5.6±0.01µs        ? ?/sec    1.00      5.5±0.01µs        ? ?/sec
filter fsb with value length 5 low selectivity (kept 1/1024)                         1.01   1197.9±2.84ns        ? ?/sec    1.00   1188.4±0.93ns        ? ?/sec
filter fsb with value length 5 w NULLs (kept 1/2)                                    1.00     86.7±0.20µs        ? ?/sec    1.05     91.2±0.10µs        ? ?/sec
filter fsb with value length 5 w NULLs high selectivity (kept 1023/1024)             1.01      8.2±0.02µs        ? ?/sec    1.00      8.1±0.01µs        ? ?/sec
filter fsb with value length 5 w NULLs low selectivity (kept 1/1024)                 1.00   1698.1±8.90ns        ? ?/sec    1.01  1718.0±10.15ns        ? ?/sec
filter fsb with value length 50 (kept 1/2)                                           1.00     96.4±0.38µs        ? ?/sec    1.01     97.9±0.83µs        ? ?/sec
filter fsb with value length 50 high selectivity (kept 1023/1024)                    1.00     70.5±0.24µs        ? ?/sec    1.00     70.6±0.76µs        ? ?/sec
filter fsb with value length 50 low selectivity (kept 1/1024)                        1.01   1265.3±1.74ns        ? ?/sec    1.00   1258.9±2.81ns        ? ?/sec
filter fsb with value length 50 w NULLs (kept 1/2)                                   1.00    126.6±0.43µs        ? ?/sec    1.01    127.8±0.36µs        ? ?/sec
filter fsb with value length 50 w NULLs high selectivity (kept 1023/1024)            1.00     68.7±0.22µs        ? ?/sec    1.01     69.2±0.59µs        ? ?/sec
filter fsb with value length 50 w NULLs low selectivity (kept 1/1024)                1.00   1774.1±2.16ns        ? ?/sec    1.01   1783.2±3.84ns        ? ?/sec
filter i32 (kept 1/2)                                                                1.00     27.3±0.13µs        ? ?/sec    1.04     28.4±0.04µs        ? ?/sec
filter i32 high selectivity (kept 1023/1024)                                         1.00      4.3±0.01µs        ? ?/sec    1.02      4.4±0.02µs        ? ?/sec
filter i32 low selectivity (kept 1/1024)                                             1.00   1157.2±3.52ns        ? ?/sec    1.01   1164.5±1.18ns        ? ?/sec
filter optimize (kept 1/2)                                                           1.00     27.9±0.05µs        ? ?/sec    1.03     28.6±0.07µs        ? ?/sec
filter optimize high selectivity (kept 1023/1024)                                    1.00   1486.5±0.76ns        ? ?/sec    1.03   1536.0±2.98ns        ? ?/sec
filter optimize low selectivity (kept 1/1024)                                        1.00    805.3±0.32ns        ? ?/sec    1.01    809.4±0.67ns        ? ?/sec
filter run array (kept 1/2)                                                          1.00    283.3±1.76µs        ? ?/sec    1.01    286.2±0.94µs        ? ?/sec
filter run array high selectivity (kept 1023/1024)                                   1.00    284.3±3.69µs        ? ?/sec    1.02    289.4±1.07µs        ? ?/sec
filter run array low selectivity (kept 1/1024)                                       1.00    235.0±0.94µs        ? ?/sec    1.00    235.3±0.88µs        ? ?/sec
filter single record batch                                                           1.00     28.4±0.02µs        ? ?/sec    1.02     29.0±0.07µs        ? ?/sec
filter u8 (kept 1/2)                                                                 1.00     27.3±0.02µs        ? ?/sec    1.00     27.5±0.05µs        ? ?/sec
filter u8 high selectivity (kept 1023/1024)                                          1.00   1853.8±6.99ns        ? ?/sec    1.00   1856.4±5.61ns        ? ?/sec
filter u8 low selectivity (kept 1/1024)                                              1.00  1129.0±14.68ns        ? ?/sec    1.00  1125.1±17.83ns        ? ?/sec

Resource Usage

base (merge-base)

Metric Value
Wall time 900.2s
Peak memory 35.3 MiB
Avg memory 22.8 MiB
CPU user 894.9s
CPU sys 0.0s
Peak spill 0 B

branch

Metric Value
Wall time 885.2s
Peak memory 40.2 MiB
Avg memory 24.5 MiB
CPU user 881.0s
CPU sys 0.1s
Peak spill 0 B

File an issue against this benchmark runner

@adriangbot

Copy link
Copy Markdown

🤖 Arrow criterion benchmark completed (GKE) | trigger

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

Comparing perf/filter-skip-all-valid-nulls (151769d) to 8c230e6 (merge-base) diff

Run configuration
run benchmark filter_kernels
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                                                                                main                                   perf_filter-skip-all-valid-nulls
-----                                                                                ----                                   --------------------------------
filter context decimal128 (kept 1/2)                                                 1.00     19.2±0.09µs        ? ?/sec    1.05     20.2±0.08µs        ? ?/sec
filter context decimal128 high selectivity (kept 1023/1024)                          1.00     18.2±0.12µs        ? ?/sec    1.02     18.6±0.21µs        ? ?/sec
filter context decimal128 low selectivity (kept 1/1024)                              1.00    145.8±0.87ns        ? ?/sec    1.01    147.8±0.46ns        ? ?/sec
filter context f32 (kept 1/2)                                                        1.00     41.8±0.02µs        ? ?/sec    1.00     42.0±0.05µs        ? ?/sec
filter context f32 high selectivity (kept 1023/1024)                                 1.02      5.5±0.01µs        ? ?/sec    1.00      5.5±0.01µs        ? ?/sec
filter context f32 low selectivity (kept 1/1024)                                     1.00    323.6±1.56ns        ? ?/sec    1.00    323.2±1.09ns        ? ?/sec
filter context fsb with value length 20 (kept 1/2)                                   1.03     47.1±0.71µs        ? ?/sec    1.00     45.8±0.19µs        ? ?/sec
filter context fsb with value length 20 high selectivity (kept 1023/1024)            1.02     25.2±0.61µs        ? ?/sec    1.00     24.8±0.44µs        ? ?/sec
filter context fsb with value length 20 low selectivity (kept 1/1024)                1.05    276.9±0.96ns        ? ?/sec    1.00    263.9±2.19ns        ? ?/sec
filter context fsb with value length 20 w NULLs (kept 1/2)                           1.00     76.1±0.17µs        ? ?/sec    1.01     77.0±0.28µs        ? ?/sec
filter context fsb with value length 20 w NULLs high selectivity (kept 1023/1024)    1.00     25.7±0.53µs        ? ?/sec    1.06     27.2±0.40µs        ? ?/sec
filter context fsb with value length 20 w NULLs low selectivity (kept 1/1024)        1.03    473.4±1.17ns        ? ?/sec    1.00    459.8±1.05ns        ? ?/sec
filter context fsb with value length 5 (kept 1/2)                                    1.03     45.8±0.08µs        ? ?/sec    1.00     44.3±0.02µs        ? ?/sec
filter context fsb with value length 5 high selectivity (kept 1023/1024)             1.00      4.8±0.01µs        ? ?/sec    1.01      4.8±0.00µs        ? ?/sec
filter context fsb with value length 5 low selectivity (kept 1/1024)                 1.01    229.4±2.82ns        ? ?/sec    1.00    227.6±2.79ns        ? ?/sec
filter context fsb with value length 5 w NULLs (kept 1/2)                            1.04     77.4±0.21µs        ? ?/sec    1.00     74.6±0.06µs        ? ?/sec
filter context fsb with value length 5 w NULLs high selectivity (kept 1023/1024)     1.00      6.6±0.01µs        ? ?/sec    1.01      6.6±0.01µs        ? ?/sec
filter context fsb with value length 5 w NULLs low selectivity (kept 1/1024)         1.00    412.9±4.10ns        ? ?/sec    1.00    414.7±3.86ns        ? ?/sec
filter context fsb with value length 50 (kept 1/2)                                   1.01     86.4±0.46µs        ? ?/sec    1.00     85.4±0.21µs        ? ?/sec
filter context fsb with value length 50 high selectivity (kept 1023/1024)            1.01     70.0±0.36µs        ? ?/sec    1.00     69.3±0.89µs        ? ?/sec
filter context fsb with value length 50 low selectivity (kept 1/1024)                1.08    313.5±0.69ns        ? ?/sec    1.00    290.3±0.75ns        ? ?/sec
filter context fsb with value length 50 w NULLs (kept 1/2)                           1.01    117.8±0.59µs        ? ?/sec    1.00    116.9±0.37µs        ? ?/sec
filter context fsb with value length 50 w NULLs high selectivity (kept 1023/1024)    1.00     66.2±0.62µs        ? ?/sec    1.01     66.7±1.43µs        ? ?/sec
filter context fsb with value length 50 w NULLs low selectivity (kept 1/1024)        1.00    494.1±0.82ns        ? ?/sec    1.01    497.8±1.90ns        ? ?/sec
filter context i32 (kept 1/2)                                                        1.00     14.0±0.13µs        ? ?/sec    1.01     14.1±0.01µs        ? ?/sec
filter context i32 high selectivity (kept 1023/1024)                                 1.01      3.7±0.01µs        ? ?/sec    1.00      3.7±0.00µs        ? ?/sec
filter context i32 low selectivity (kept 1/1024)                                     1.02    139.3±4.74ns        ? ?/sec    1.00    136.1±1.10ns        ? ?/sec
filter context i32 w NULLs (kept 1/2)                                                1.01     43.5±0.64µs        ? ?/sec    1.00     43.2±0.07µs        ? ?/sec
filter context i32 w NULLs at end (kept 1/2)                                         1.00     43.3±0.61µs        ? ?/sec    1.01     43.9±0.05µs        ? ?/sec
filter context i32 w NULLs at end high selectivity (kept 1023/1024)                  1.00      5.5±0.01µs        ? ?/sec    1.18      6.4±0.01µs        ? ?/sec
filter context i32 w NULLs high selectivity (kept 1023/1024)                         1.00      5.5±0.01µs        ? ?/sec    1.00      5.5±0.01µs        ? ?/sec
filter context i32 w NULLs low selectivity (kept 1/1024)                             1.01    329.3±1.55ns        ? ?/sec    1.00    327.6±0.80ns        ? ?/sec
filter context i32 w NULLs, only valid (kept 1/4)                                    2.65     19.7±0.10µs        ? ?/sec    1.00      7.4±0.00µs        ? ?/sec
filter context i32 w NULLs, only valid high selectivity (kept 1023/2048)             3.10     42.2±0.07µs        ? ?/sec    1.00     13.6±0.80µs        ? ?/sec
filter context i32 w NULLs, only valid low selectivity (kept 1/2048)                 1.75    227.1±0.80ns        ? ?/sec    1.00    130.1±0.52ns        ? ?/sec
filter context mixed string view (kept 1/2)                                          1.00     49.8±0.25µs        ? ?/sec    1.02     50.9±0.29µs        ? ?/sec
filter context mixed string view high selectivity (kept 1023/1024)                   1.00     20.6±0.15µs        ? ?/sec    1.04     21.5±0.13µs        ? ?/sec
filter context mixed string view low selectivity (kept 1/1024)                       1.00    319.6±2.10ns        ? ?/sec    1.02    324.5±3.00ns        ? ?/sec
filter context short string view (kept 1/2)                                          1.00     49.1±0.15µs        ? ?/sec    1.04     51.0±0.16µs        ? ?/sec
filter context short string view high selectivity (kept 1023/1024)                   1.00     19.5±0.16µs        ? ?/sec    1.09     21.3±0.24µs        ? ?/sec
filter context short string view low selectivity (kept 1/1024)                       1.00    321.3±2.74ns        ? ?/sec    1.01    324.4±2.74ns        ? ?/sec
filter context string (kept 1/2)                                                     1.00    381.6±1.10µs        ? ?/sec    1.00    383.0±1.23µs        ? ?/sec
filter context string dictionary (kept 1/2)                                          1.00     12.4±0.02µs        ? ?/sec    1.01     12.4±0.02µs        ? ?/sec
filter context string dictionary high selectivity (kept 1023/1024)                   1.00      3.7±0.00µs        ? ?/sec    1.00      3.7±0.01µs        ? ?/sec
filter context string dictionary low selectivity (kept 1/1024)                       1.00    196.7±1.16ns        ? ?/sec    1.00    196.6±1.24ns        ? ?/sec
filter context string dictionary w NULLs (kept 1/2)                                  1.00     43.6±0.75µs        ? ?/sec    1.01     44.2±0.52µs        ? ?/sec
filter context string dictionary w NULLs high selectivity (kept 1023/1024)           1.00      5.6±0.01µs        ? ?/sec    1.00      5.6±0.01µs        ? ?/sec
filter context string dictionary w NULLs low selectivity (kept 1/1024)               1.00    388.1±2.71ns        ? ?/sec    1.01    392.4±2.96ns        ? ?/sec
filter context string high selectivity (kept 1023/1024)                              1.00    312.4±1.45µs        ? ?/sec    1.01    316.0±1.53µs        ? ?/sec
filter context string low selectivity (kept 1/1024)                                  1.00    758.5±2.19ns        ? ?/sec    1.00    755.7±0.84ns        ? ?/sec
filter context u8 (kept 1/2)                                                         1.01     12.1±0.01µs        ? ?/sec    1.00     12.1±0.02µs        ? ?/sec
filter context u8 high selectivity (kept 1023/1024)                                  1.00   1048.4±5.35ns        ? ?/sec    1.02   1067.0±3.64ns        ? ?/sec
filter context u8 low selectivity (kept 1/1024)                                      1.00    128.0±4.43ns        ? ?/sec    1.00    127.6±0.28ns        ? ?/sec
filter context u8 w NULLs (kept 1/2)                                                 1.00     42.5±0.05µs        ? ?/sec    1.01     42.9±0.13µs        ? ?/sec
filter context u8 w NULLs high selectivity (kept 1023/1024)                          1.00      2.8±0.01µs        ? ?/sec    1.03      2.9±0.01µs        ? ?/sec
filter context u8 w NULLs low selectivity (kept 1/1024)                              1.00    308.7±1.71ns        ? ?/sec    1.00    307.6±1.57ns        ? ?/sec
filter decimal128 (kept 1/2)                                                         1.00     29.9±0.05µs        ? ?/sec    1.03     30.7±0.08µs        ? ?/sec
filter decimal128 high selectivity (kept 1023/1024)                                  1.00     19.4±0.12µs        ? ?/sec    1.03     20.0±0.19µs        ? ?/sec
filter decimal128 low selectivity (kept 1/1024)                                      1.01   1227.4±2.14ns        ? ?/sec    1.00   1215.7±5.88ns        ? ?/sec
filter f32 (kept 1/2)                                                                1.00     59.1±0.09µs        ? ?/sec    1.01     59.7±0.12µs        ? ?/sec
filter fsb with value length 20 (kept 1/2)                                           1.00     58.6±0.09µs        ? ?/sec    1.07     62.8±0.08µs        ? ?/sec
filter fsb with value length 20 high selectivity (kept 1023/1024)                    1.00     23.0±0.23µs        ? ?/sec    1.10     25.3±0.40µs        ? ?/sec
filter fsb with value length 20 low selectivity (kept 1/1024)                        1.00   1238.6±1.81ns        ? ?/sec    1.00   1241.4±2.41ns        ? ?/sec
filter fsb with value length 20 w NULLs (kept 1/2)                                   1.00     90.9±0.12µs        ? ?/sec    1.03     93.3±0.14µs        ? ?/sec
filter fsb with value length 20 w NULLs high selectivity (kept 1023/1024)            1.00     25.4±0.17µs        ? ?/sec    1.04     26.5±0.22µs        ? ?/sec
filter fsb with value length 20 w NULLs low selectivity (kept 1/1024)                1.00   1773.1±2.98ns        ? ?/sec    1.01   1795.9±4.69ns        ? ?/sec
filter fsb with value length 5 (kept 1/2)                                            1.00     55.8±0.05µs        ? ?/sec    1.09     60.9±0.04µs        ? ?/sec
filter fsb with value length 5 high selectivity (kept 1023/1024)                     1.00      5.5±0.01µs        ? ?/sec    1.02      5.6±0.01µs        ? ?/sec
filter fsb with value length 5 low selectivity (kept 1/1024)                         1.01   1201.0±2.67ns        ? ?/sec    1.00   1194.4±0.70ns        ? ?/sec
filter fsb with value length 5 w NULLs (kept 1/2)                                    1.00     86.8±0.04µs        ? ?/sec    1.07     92.8±1.33µs        ? ?/sec
filter fsb with value length 5 w NULLs high selectivity (kept 1023/1024)             1.00      8.0±0.01µs        ? ?/sec    1.01      8.1±0.01µs        ? ?/sec
filter fsb with value length 5 w NULLs low selectivity (kept 1/1024)                 1.00   1702.3±8.27ns        ? ?/sec    1.01  1721.5±10.54ns        ? ?/sec
filter fsb with value length 50 (kept 1/2)                                           1.00     93.3±0.42µs        ? ?/sec    1.01     94.5±0.28µs        ? ?/sec
filter fsb with value length 50 high selectivity (kept 1023/1024)                    1.00     71.1±0.56µs        ? ?/sec    1.01     71.7±0.76µs        ? ?/sec
filter fsb with value length 50 low selectivity (kept 1/1024)                        1.01   1269.7±1.46ns        ? ?/sec    1.00   1262.7±1.20ns        ? ?/sec
filter fsb with value length 50 w NULLs (kept 1/2)                                   1.00    123.9±0.30µs        ? ?/sec    1.02    126.0±0.82µs        ? ?/sec
filter fsb with value length 50 w NULLs high selectivity (kept 1023/1024)            1.00     68.6±0.55µs        ? ?/sec    1.00     68.4±0.68µs        ? ?/sec
filter fsb with value length 50 w NULLs low selectivity (kept 1/1024)                1.00   1777.0±2.90ns        ? ?/sec    1.00   1783.0±3.69ns        ? ?/sec
filter i32 (kept 1/2)                                                                1.00     27.4±0.07µs        ? ?/sec    1.03     28.3±0.05µs        ? ?/sec
filter i32 high selectivity (kept 1023/1024)                                         1.00      4.3±0.01µs        ? ?/sec    1.01      4.4±0.01µs        ? ?/sec
filter i32 low selectivity (kept 1/1024)                                             1.00   1162.5±4.45ns        ? ?/sec    1.01   1168.5±2.82ns        ? ?/sec
filter optimize (kept 1/2)                                                           1.00     28.2±0.12µs        ? ?/sec    1.00     28.1±0.02µs        ? ?/sec
filter optimize high selectivity (kept 1023/1024)                                    1.00   1487.3±2.77ns        ? ?/sec    1.03   1534.2±0.81ns        ? ?/sec
filter optimize low selectivity (kept 1/1024)                                        1.00    810.3±7.30ns        ? ?/sec    1.01   814.9±10.10ns        ? ?/sec
filter run array (kept 1/2)                                                          1.00    282.4±2.12µs        ? ?/sec    1.01    285.5±0.87µs        ? ?/sec
filter run array high selectivity (kept 1023/1024)                                   1.00    284.1±3.74µs        ? ?/sec    1.02    289.8±1.05µs        ? ?/sec
filter run array low selectivity (kept 1/1024)                                       1.00    235.3±0.82µs        ? ?/sec    1.00    235.5±0.89µs        ? ?/sec
filter single record batch                                                           1.00     28.6±0.03µs        ? ?/sec    1.02     29.1±0.10µs        ? ?/sec
filter u8 (kept 1/2)                                                                 1.00     27.4±0.03µs        ? ?/sec    1.00     27.3±0.02µs        ? ?/sec
filter u8 high selectivity (kept 1023/1024)                                          1.00  1844.8±10.45ns        ? ?/sec    1.01   1859.6±7.17ns        ? ?/sec
filter u8 low selectivity (kept 1/1024)                                              1.00  1131.6±17.37ns        ? ?/sec    1.00  1129.1±17.98ns        ? ?/sec

Resource Usage

base (merge-base)

Metric Value
Wall time 890.2s
Peak memory 35.3 MiB
Avg memory 22.7 MiB
CPU user 887.7s
CPU sys 0.1s
Peak spill 0 B

branch

Metric Value
Wall time 880.2s
Peak memory 41.8 MiB
Avg memory 24.8 MiB
CPU user 877.0s
CPU sys 0.1s
Peak spill 0 B

File an issue against this benchmark runner

@bharadwaj-pendyala

Copy link
Copy Markdown
Contributor Author

Both reruns agree on the only-valid rows: 2.6x at kept 1/4, 3.1-3.2x at 1023/2048, 1.8x at 1/2048.

The nulls-at-end dense row came out worse than my PR description says, though. It went from 5.5-5.6 µs to 6.4 µs (14% and 18%), against the ~7% I measured on my M1. That row is the worst case on purpose, with the one selected null in the last word, so the scan reads both bitmaps in full before filter_bits reads them again. I've fixed the number in the description.

@Jefffrey Jefffrey added the performance Speed or memory optimizations label Oct 6, 2026
etseidl pushed a commit to etseidl/arrow-rs that referenced this pull request Oct 8, 2026
…pache#11399)

- related to apache#11257

i wanted to run all the benchmarks which exhibit affected `filter_nulls`
path, but looks like there were some benchmarks that exhibited that path
but didnt actually have `NULLS` in the name so its harder to ensure we
get a comprehensive run

fix generated by codex & reviewed by me
@Jefffrey

Jefffrey commented Oct 9, 2026

Copy link
Copy Markdown
Contributor

run benchmark filter_kernels
env:
BENCH_FILTER: NULL

@adriangbot

This comment was marked as duplicate.

@adriangbot

Copy link
Copy Markdown

🤖 Benchmark completed (GKE) | trigger

Target: filter_kernels

Comparing perf/filter-skip-all-valid-nulls (3770a3c) to e189ba8 (merge-base) diff

Run configuration
run benchmark filter_kernels
env:
  BENCH_FILTER: 'NULL'
shards: 1
Details
group                                                                                base                                   changed
-----                                                                                ----                                   -------
filter context f32 w NULLs (kept 1/2)                                                1.00     42.2±0.74µs        ? ?/sec    1.08     45.4±0.04µs        ? ?/sec
filter context f32 w NULLs high selectivity (kept 1023/1024)                         1.00      5.5±0.01µs        ? ?/sec    1.01      5.5±0.01µs        ? ?/sec
filter context f32 w NULLs low selectivity (kept 1/1024)                             1.00    326.0±1.19ns        ? ?/sec    1.00    325.2±0.66ns        ? ?/sec
filter context fsb with value length 20 w NULLs (kept 1/2)                           1.00     75.5±0.11µs        ? ?/sec    1.03     77.5±0.23µs        ? ?/sec
filter context fsb with value length 20 w NULLs high selectivity (kept 1023/1024)    1.04     26.8±0.36µs        ? ?/sec    1.00     25.8±0.15µs        ? ?/sec
filter context fsb with value length 20 w NULLs low selectivity (kept 1/1024)        1.00    462.9±1.24ns        ? ?/sec    1.00    464.6±1.51ns        ? ?/sec
filter context fsb with value length 5 w NULLs (kept 1/2)                            1.00     74.4±0.05µs        ? ?/sec    1.02     76.0±0.12µs        ? ?/sec
filter context fsb with value length 5 w NULLs high selectivity (kept 1023/1024)     1.00      6.6±0.01µs        ? ?/sec    1.00      6.6±0.01µs        ? ?/sec
filter context fsb with value length 5 w NULLs low selectivity (kept 1/1024)         1.00    424.7±9.70ns        ? ?/sec    1.01    429.3±0.84ns        ? ?/sec
filter context fsb with value length 50 w NULLs (kept 1/2)                           1.00    116.0±0.26µs        ? ?/sec    1.05    121.9±0.52µs        ? ?/sec
filter context fsb with value length 50 w NULLs high selectivity (kept 1023/1024)    1.00     65.4±0.63µs        ? ?/sec    1.01     66.1±0.26µs        ? ?/sec
filter context fsb with value length 50 w NULLs low selectivity (kept 1/1024)        1.02    508.1±1.93ns        ? ?/sec    1.00    496.9±1.19ns        ? ?/sec
filter context i32 w NULLs (kept 1/2)                                                1.00     41.7±0.06µs        ? ?/sec    1.06     44.2±0.06µs        ? ?/sec
filter context i32 w NULLs at end (kept 1/2)                                         1.00     42.3±0.06µs        ? ?/sec    1.08     45.6±0.13µs        ? ?/sec
filter context i32 w NULLs at end high selectivity (kept 1023/1024)                  1.00      5.5±0.01µs        ? ?/sec    1.21      6.7±0.03µs        ? ?/sec
filter context i32 w NULLs high selectivity (kept 1023/1024)                         1.01      5.5±0.01µs        ? ?/sec    1.00      5.5±0.01µs        ? ?/sec
filter context i32 w NULLs low selectivity (kept 1/1024)                             1.01    328.4±1.25ns        ? ?/sec    1.00    325.7±0.77ns        ? ?/sec
filter context i32 w NULLs, only valid (kept 1/4)                                    2.62     19.6±0.04µs        ? ?/sec    1.00      7.5±0.01µs        ? ?/sec
filter context i32 w NULLs, only valid high selectivity (kept 1023/2048)             3.27     42.9±1.20µs        ? ?/sec    1.00     13.1±0.02µs        ? ?/sec
filter context i32 w NULLs, only valid low selectivity (kept 1/2048)                 1.69    228.6±0.99ns        ? ?/sec    1.00    135.6±2.21ns        ? ?/sec
filter context mixed string view w NULLs (kept 1/2)                                  1.00     49.8±0.13µs        ? ?/sec    1.06     52.6±0.15µs        ? ?/sec
filter context mixed string view w NULLs high selectivity (kept 1023/1024)           1.00     21.0±0.08µs        ? ?/sec    1.03     21.6±0.17µs        ? ?/sec
filter context mixed string view w NULLs low selectivity (kept 1/1024)               1.02    330.2±2.94ns        ? ?/sec    1.00    323.1±2.06ns        ? ?/sec
filter context short string view w NULLs (kept 1/2)                                  1.00     50.6±0.14µs        ? ?/sec    1.04     52.7±0.17µs        ? ?/sec
filter context short string view w NULLs high selectivity (kept 1023/1024)           1.00     21.2±0.15µs        ? ?/sec    1.02     21.6±0.23µs        ? ?/sec
filter context short string view w NULLs low selectivity (kept 1/1024)               1.00    333.8±3.17ns        ? ?/sec    1.00    332.3±2.87ns        ? ?/sec
filter context string dictionary w NULLs (kept 1/2)                                  1.00     42.0±0.02µs        ? ?/sec    1.09     45.7±0.05µs        ? ?/sec
filter context string dictionary w NULLs high selectivity (kept 1023/1024)           1.02      5.6±0.01µs        ? ?/sec    1.00      5.5±0.01µs        ? ?/sec
filter context string dictionary w NULLs low selectivity (kept 1/1024)               1.00    390.0±2.41ns        ? ?/sec    1.02    397.1±8.29ns        ? ?/sec
filter context string w NULLs (kept 1/2)                                             1.00    384.5±1.27µs        ? ?/sec    1.01    387.5±2.15µs        ? ?/sec
filter context string w NULLs high selectivity (kept 1023/1024)                      1.00    316.3±0.73µs        ? ?/sec    1.00    314.9±0.77µs        ? ?/sec
filter context string w NULLs low selectivity (kept 1/1024)                          1.03    700.1±4.20ns        ? ?/sec    1.00    682.7±3.52ns        ? ?/sec
filter context u8 w NULLs (kept 1/2)                                                 1.00     41.9±0.03µs        ? ?/sec    1.05     43.9±0.06µs        ? ?/sec
filter context u8 w NULLs high selectivity (kept 1023/1024)                          1.00      2.8±0.01µs        ? ?/sec    1.00      2.8±0.01µs        ? ?/sec
filter context u8 w NULLs low selectivity (kept 1/1024)                              1.02    316.4±0.85ns        ? ?/sec    1.00    309.7±2.02ns        ? ?/sec
filter f32 w NULLs (kept 1/2)                                                        1.02     62.1±0.13µs        ? ?/sec    1.00     61.1±0.05µs        ? ?/sec
filter fsb with value length 20 w NULLs (kept 1/2)                                   1.00     88.2±0.28µs        ? ?/sec    1.06     93.4±0.14µs        ? ?/sec
filter fsb with value length 20 w NULLs high selectivity (kept 1023/1024)            1.00     26.0±0.26µs        ? ?/sec    1.03     26.9±0.19µs        ? ?/sec
filter fsb with value length 20 w NULLs low selectivity (kept 1/1024)                1.00   1750.9±2.66ns        ? ?/sec    1.03   1810.3±2.41ns        ? ?/sec
filter fsb with value length 5 w NULLs (kept 1/2)                                    1.00     86.4±0.07µs        ? ?/sec    1.03     89.3±0.06µs        ? ?/sec
filter fsb with value length 5 w NULLs high selectivity (kept 1023/1024)             1.00      8.0±0.01µs        ? ?/sec    1.00      8.0±0.01µs        ? ?/sec
filter fsb with value length 5 w NULLs low selectivity (kept 1/1024)                 1.00  1703.7±14.86ns        ? ?/sec    1.03   1749.8±1.58ns        ? ?/sec
filter fsb with value length 50 w NULLs (kept 1/2)                                   1.00    124.0±0.42µs        ? ?/sec    1.03    128.0±0.50µs        ? ?/sec
filter fsb with value length 50 w NULLs high selectivity (kept 1023/1024)            1.00     68.2±0.40µs        ? ?/sec    1.02     69.2±0.29µs        ? ?/sec
filter fsb with value length 50 w NULLs low selectivity (kept 1/1024)                1.00   1768.8±2.50ns        ? ?/sec    1.00   1764.5±3.75ns        ? ?/sec

Per-runner information
filter_kernels — shard 1/1

Node: gk3-benchmark-cluster-nap-zev6bi7t-2df76d26-zqlk

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

uname:

Linux bench-c6073126936-3222-ps4l6 6.12.94+ #1 SMP Fri Aug 21 08:00:16 UTC 2026 aarch64 GNU/Linux

BENCH_COMMAND:

cargo bench --features=arrow,async,test_common,experimental,object_store --bench filter_kernels
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
Resource Usage

base (merge-base)

Metric Value
Wall time 455.1s
Peak memory 47.3 MiB
Avg memory 26.8 MiB
CPU user 453.3s
CPU sys 0.0s
Peak spill 0 B

branch

Metric Value
Wall time 450.1s
Peak memory 39.5 MiB
Avg memory 24.8 MiB
CPU user 445.5s
CPU sys 0.0s
Peak spill 0 B

File an issue against this benchmark runner

@Jefffrey

Jefffrey commented Oct 9, 2026

Copy link
Copy Markdown
Contributor

run benchmark filter_kernels
env:
BENCH_FILTER: NULL

@adriangbot

This comment was marked as duplicate.

@adriangbot

Copy link
Copy Markdown

🤖 Benchmark completed (GKE) | trigger

Target: filter_kernels

Comparing perf/filter-skip-all-valid-nulls (3770a3c) to e189ba8 (merge-base) diff

Run configuration
run benchmark filter_kernels
env:
  BENCH_FILTER: 'NULL'
shards: 1
Details
group                                                                                base                                   changed
-----                                                                                ----                                   -------
filter context f32 w NULLs (kept 1/2)                                                1.00     41.4±0.06µs        ? ?/sec    1.04     43.1±0.05µs        ? ?/sec
filter context f32 w NULLs high selectivity (kept 1023/1024)                         1.00      5.5±0.01µs        ? ?/sec    1.01      5.5±0.01µs        ? ?/sec
filter context f32 w NULLs low selectivity (kept 1/1024)                             1.00    329.0±1.91ns        ? ?/sec    1.01    332.5±6.46ns        ? ?/sec
filter context fsb with value length 20 w NULLs (kept 1/2)                           1.00     75.8±0.15µs        ? ?/sec    1.06     80.5±1.08µs        ? ?/sec
filter context fsb with value length 20 w NULLs high selectivity (kept 1023/1024)    1.05     27.3±0.31µs        ? ?/sec    1.00     26.0±0.30µs        ? ?/sec
filter context fsb with value length 20 w NULLs low selectivity (kept 1/1024)        1.05    481.0±1.93ns        ? ?/sec    1.00    456.4±1.77ns        ? ?/sec
filter context fsb with value length 5 w NULLs (kept 1/2)                            1.00     74.4±0.11µs        ? ?/sec    1.02     76.1±0.05µs        ? ?/sec
filter context fsb with value length 5 w NULLs high selectivity (kept 1023/1024)     1.00      6.5±0.01µs        ? ?/sec    1.02      6.7±0.01µs        ? ?/sec
filter context fsb with value length 5 w NULLs low selectivity (kept 1/1024)         1.01    424.9±9.26ns        ? ?/sec    1.00    422.3±1.11ns        ? ?/sec
filter context fsb with value length 50 w NULLs (kept 1/2)                           1.00    119.1±0.26µs        ? ?/sec    1.00    119.6±0.62µs        ? ?/sec
filter context fsb with value length 50 w NULLs high selectivity (kept 1023/1024)    1.02     67.3±0.22µs        ? ?/sec    1.00     66.2±0.51µs        ? ?/sec
filter context fsb with value length 50 w NULLs low selectivity (kept 1/1024)        1.01    497.9±1.15ns        ? ?/sec    1.00    494.9±1.50ns        ? ?/sec
filter context i32 w NULLs (kept 1/2)                                                1.00     42.0±0.03µs        ? ?/sec    1.06     44.6±0.84µs        ? ?/sec
filter context i32 w NULLs at end (kept 1/2)                                         1.00     42.1±0.09µs        ? ?/sec    1.09     46.0±0.35µs        ? ?/sec
filter context i32 w NULLs at end high selectivity (kept 1023/1024)                  1.00      5.5±0.01µs        ? ?/sec    1.18      6.5±0.01µs        ? ?/sec
filter context i32 w NULLs high selectivity (kept 1023/1024)                         1.01      5.5±0.01µs        ? ?/sec    1.00      5.5±0.01µs        ? ?/sec
filter context i32 w NULLs low selectivity (kept 1/1024)                             1.01    329.4±1.53ns        ? ?/sec    1.00    325.9±1.33ns        ? ?/sec
filter context i32 w NULLs, only valid (kept 1/4)                                    2.66     19.7±0.17µs        ? ?/sec    1.00      7.4±0.00µs        ? ?/sec
filter context i32 w NULLs, only valid high selectivity (kept 1023/2048)             3.33     43.7±0.61µs        ? ?/sec    1.00     13.1±0.01µs        ? ?/sec
filter context i32 w NULLs, only valid low selectivity (kept 1/2048)                 1.73    228.9±0.36ns        ? ?/sec    1.00    132.1±2.16ns        ? ?/sec
filter context mixed string view w NULLs (kept 1/2)                                  1.00     50.0±0.10µs        ? ?/sec    1.04     52.0±0.14µs        ? ?/sec
filter context mixed string view w NULLs high selectivity (kept 1023/1024)           1.00     20.1±0.13µs        ? ?/sec    1.04     20.9±0.09µs        ? ?/sec
filter context mixed string view w NULLs low selectivity (kept 1/1024)               1.01    325.6±1.86ns        ? ?/sec    1.00    323.8±2.77ns        ? ?/sec
filter context short string view w NULLs (kept 1/2)                                  1.00     51.7±0.28µs        ? ?/sec    1.02     52.9±0.71µs        ? ?/sec
filter context short string view w NULLs high selectivity (kept 1023/1024)           1.03     22.1±0.11µs        ? ?/sec    1.00     21.5±0.12µs        ? ?/sec
filter context short string view w NULLs low selectivity (kept 1/1024)               1.00    322.5±2.33ns        ? ?/sec    1.01    324.8±2.99ns        ? ?/sec
filter context string dictionary w NULLs (kept 1/2)                                  1.00     41.9±0.05µs        ? ?/sec    1.05     43.9±0.07µs        ? ?/sec
filter context string dictionary w NULLs high selectivity (kept 1023/1024)           1.00      5.6±0.01µs        ? ?/sec    1.00      5.6±0.01µs        ? ?/sec
filter context string dictionary w NULLs low selectivity (kept 1/1024)               1.00    391.8±3.71ns        ? ?/sec    1.02    397.7±2.20ns        ? ?/sec
filter context string w NULLs (kept 1/2)                                             1.01    387.1±2.29µs        ? ?/sec    1.00    383.7±1.07µs        ? ?/sec
filter context string w NULLs high selectivity (kept 1023/1024)                      1.02    320.8±1.40µs        ? ?/sec    1.00    314.0±1.02µs        ? ?/sec
filter context string w NULLs low selectivity (kept 1/1024)                          1.01    694.4±5.11ns        ? ?/sec    1.00    684.1±2.87ns        ? ?/sec
filter context u8 w NULLs (kept 1/2)                                                 1.00     43.3±0.05µs        ? ?/sec    1.00     43.5±0.06µs        ? ?/sec
filter context u8 w NULLs high selectivity (kept 1023/1024)                          1.00      2.8±0.01µs        ? ?/sec    1.00      2.8±0.01µs        ? ?/sec
filter context u8 w NULLs low selectivity (kept 1/1024)                              1.00    316.5±1.96ns        ? ?/sec    1.00    316.1±6.06ns        ? ?/sec
filter f32 w NULLs (kept 1/2)                                                        1.01     61.6±0.07µs        ? ?/sec    1.00     61.2±0.09µs        ? ?/sec
filter fsb with value length 20 w NULLs (kept 1/2)                                   1.00     87.9±0.14µs        ? ?/sec    1.03     90.2±0.14µs        ? ?/sec
filter fsb with value length 20 w NULLs high selectivity (kept 1023/1024)            1.01     26.8±0.24µs        ? ?/sec    1.00     26.5±0.29µs        ? ?/sec
filter fsb with value length 20 w NULLs low selectivity (kept 1/1024)                1.00   1775.6±2.04ns        ? ?/sec    1.02   1811.4±2.49ns        ? ?/sec
filter fsb with value length 5 w NULLs (kept 1/2)                                    1.00     85.6±0.05µs        ? ?/sec    1.02     87.2±0.18µs        ? ?/sec
filter fsb with value length 5 w NULLs high selectivity (kept 1023/1024)             1.00      8.0±0.01µs        ? ?/sec    1.02      8.1±0.01µs        ? ?/sec
filter fsb with value length 5 w NULLs low selectivity (kept 1/1024)                 1.00  1700.2±14.23ns        ? ?/sec    1.02   1732.4±9.39ns        ? ?/sec
filter fsb with value length 50 w NULLs (kept 1/2)                                   1.01    128.2±0.36µs        ? ?/sec    1.00    126.6±0.31µs        ? ?/sec
filter fsb with value length 50 w NULLs high selectivity (kept 1023/1024)            1.01     69.4±0.25µs        ? ?/sec    1.00     68.7±0.28µs        ? ?/sec
filter fsb with value length 50 w NULLs low selectivity (kept 1/1024)                1.00   1765.4±1.83ns        ? ?/sec    1.01   1782.7±1.48ns        ? ?/sec

Per-runner information
filter_kernels — shard 1/1

Node: gk3-benchmark-cluster-nap-qrixxqdb-3ecd588e-tflj

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

uname:

Linux bench-c6073367202-3223-rfkqx 6.12.94+ #1 SMP Fri Aug 21 08:00:16 UTC 2026 aarch64 GNU/Linux

BENCH_COMMAND:

cargo bench --features=arrow,async,test_common,experimental,object_store --bench filter_kernels
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
Resource Usage

base (merge-base)

Metric Value
Wall time 460.1s
Peak memory 45.4 MiB
Avg memory 26.0 MiB
CPU user 454.3s
CPU sys 0.0s
Peak spill 0 B

branch

Metric Value
Wall time 455.1s
Peak memory 28.7 MiB
Avg memory 22.1 MiB
CPU user 449.5s
CPU sys 0.0s
Peak spill 0 B

File an issue against this benchmark runner

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

the improvement makes sense to me and the benchmark improvement looks good; i guess with adding this logic its inevitable that there are tiny regressions since we are adding extra instructions, so not sure if they are significant enough to block the PR (would be glad to have a second opinion)

one note is that the test code seems a bit unintuitive in how it constructs its test cases, i feel they can be simplified and/or explained better

Comment thread arrow-select/src/filter.rs Outdated
#[should_panic(expected = "nulls.len() >= len")]
fn test_filter_nulls_shorter_than_filter() {
let nulls = NullBuffer::from_iter((0..8).map(|i| i != 1));
let predicate = BooleanArray::from_iter((0..9).map(|i| Some(i == 0)));

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.

instead of constructing these from a mapped iter we can just construct them directly from vecs of bools

Comment thread arrow-select/src/filter.rs Outdated

// Sliced at offset 1 so the null bits sit off a byte boundary, with a
// partial trailing word. Rows 0 and 129 are null.
fn nullable_slice(null_every: i32) -> Int32Array {

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.

the numbers chosen here seem odd and out of place; why choose a big value like 131? and why are rows 0 and 129 guaranteed to be null here, wouldnt that depend on the input?

Comment thread arrow-select/src/filter.rs Outdated

#[test]
fn test_filter_nulls_selecting_only_valid_rows() {
// Every 43rd row null puts the dense filter above the slices threshold

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.

which slices threshold are we talking about here?

Comment thread arrow-select/src/filter.rs Outdated
let nulls = values.nulls().unwrap();
let masks = filter_masks(|i| nulls.is_valid(i))
.into_iter()
.chain(filter_masks(|i| i == 128));

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.

why is this chain necessary, what does it achieve in the test?

@bharadwaj-pendyala

Copy link
Copy Markdown
Contributor Author

Reworked the filter_nulls tests in 27f8312. nullable_values now builds 200 rows from a vec and nulls out NULL_ROWS = [0, 64, 199] instead of deriving the null rows from a modulo. That covers three full words plus an 8-bit partial one, with each null row in a different word. The threshold comment now names FILTER_SLICES_SELECTIVITY_THRESHOLD, the remaining chain only builds the same mask at offset 1 and says so in a comment, and test_filter_nulls_too_large builds its nulls and mask from vecs.

287ff06 moves the selects_null call below the None and All arms, so those two strategies skip the scan. The length assert stays in filter_nulls with its old message. The description's note about new nulls.len() >= len panic text no longer applies. cargo test -p arrow-select passed all 456 tests.

@github-actions github-actions Bot added the arrow-kernels Crates that transform arrow data (e.g. compute, cast) label Oct 25, 2026
@bharadwaj-pendyala

Copy link
Copy Markdown
Contributor Author

@Rich-T-kid, could you take a look? CI is green on 77ae0c5, and it still merges cleanly on top of the Boolean filter changes from #11918.

@Jefffrey

Copy link
Copy Markdown
Contributor

run benchmark filter_kernels
env:
BENCH_FILTER: NULL

@adriangbot

This comment was marked as duplicate.

@adriangbot

Copy link
Copy Markdown

🤖 Benchmark completed (GKE) | trigger

Target: filter_kernels

Comparing perf/filter-skip-all-valid-nulls (2d7a8d2) to 6ec6d46 (merge-base) diff

Run configuration
run benchmark filter_kernels
env:
  BENCH_FILTER: 'NULL'
shards: 1
Details
group                                                                                base                                   changed
-----                                                                                ----                                   -------
filter boolean w NULLs (kept 1/2)                                                    1.00     17.3±0.01µs        ? ?/sec    1.00     17.3±0.01µs        ? ?/sec
filter boolean w NULLs high selectivity (kept 1023/1024)                             1.00      4.9±0.01µs        ? ?/sec    1.00      4.9±0.01µs        ? ?/sec
filter boolean w NULLs low selectivity (kept 1/1024)                                 1.00   1162.0±1.50ns        ? ?/sec    1.19   1380.5±5.78ns        ? ?/sec
filter context boolean w NULLs (kept 1/2)                                            1.00     17.2±0.02µs        ? ?/sec    1.00     17.1±0.01µs        ? ?/sec
filter context boolean w NULLs high selectivity (kept 1023/1024)                     1.00      3.2±0.02µs        ? ?/sec    1.00      3.2±0.02µs        ? ?/sec
filter context boolean w NULLs low selectivity (kept 1/1024)                         1.00    392.5±1.77ns        ? ?/sec    1.02    401.1±1.54ns        ? ?/sec
filter context f32 w NULLs (kept 1/2)                                                1.03     20.9±0.05µs        ? ?/sec    1.00     20.2±0.06µs        ? ?/sec
filter context f32 w NULLs high selectivity (kept 1023/1024)                         1.01      5.4±0.01µs        ? ?/sec    1.00      5.3±0.01µs        ? ?/sec
filter context f32 w NULLs low selectivity (kept 1/1024)                             1.01    315.9±2.55ns        ? ?/sec    1.00    314.1±3.38ns        ? ?/sec
filter context fixed_size_list<i32> w NULLs (kept 1/2)                               1.01    689.2±7.13µs        ? ?/sec    1.00    682.7±3.08µs        ? ?/sec
filter context fixed_size_list<i32> w NULLs high selectivity (kept 1023/1024)        1.00     70.7±0.14µs        ? ?/sec    1.03     73.0±0.66µs        ? ?/sec
filter context fixed_size_list<i32> w NULLs low selectivity (kept 1/1024)            1.00      4.1±0.01µs        ? ?/sec    1.00      4.1±0.01µs        ? ?/sec
filter context fsb with value length 20 w NULLs (kept 1/2)                           1.00     54.2±0.82µs        ? ?/sec    1.00     54.0±0.18µs        ? ?/sec
filter context fsb with value length 20 w NULLs high selectivity (kept 1023/1024)    1.00     25.2±0.55µs        ? ?/sec    1.14     28.7±0.67µs        ? ?/sec
filter context fsb with value length 20 w NULLs low selectivity (kept 1/1024)        1.04    477.8±2.98ns        ? ?/sec    1.00    457.4±2.72ns        ? ?/sec
filter context fsb with value length 5 w NULLs (kept 1/2)                            1.02     53.9±0.90µs        ? ?/sec    1.00     53.1±0.11µs        ? ?/sec
filter context fsb with value length 5 w NULLs high selectivity (kept 1023/1024)     1.00      6.5±0.02µs        ? ?/sec    1.00      6.5±0.02µs        ? ?/sec
filter context fsb with value length 5 w NULLs low selectivity (kept 1/1024)         1.00    432.7±3.85ns        ? ?/sec    1.00    434.3±2.80ns        ? ?/sec
filter context fsb with value length 50 w NULLs (kept 1/2)                           1.01    100.3±3.15µs        ? ?/sec    1.00     99.1±0.27µs        ? ?/sec
filter context fsb with value length 50 w NULLs high selectivity (kept 1023/1024)    1.04     68.6±4.62µs        ? ?/sec    1.00     65.7±3.37µs        ? ?/sec
filter context fsb with value length 50 w NULLs low selectivity (kept 1/1024)        1.05    503.0±2.76ns        ? ?/sec    1.00    478.2±2.93ns        ? ?/sec
filter context i32 w NULLs (kept 1/2)                                                1.00     20.9±0.01µs        ? ?/sec    1.00     20.9±0.05µs        ? ?/sec
filter context i32 w NULLs at end (kept 1/2)                                         1.00     21.0±0.09µs        ? ?/sec    1.04     21.8±0.04µs        ? ?/sec
filter context i32 w NULLs at end high selectivity (kept 1023/1024)                  1.00      5.3±0.01µs        ? ?/sec    1.18      6.3±0.02µs        ? ?/sec
filter context i32 w NULLs high selectivity (kept 1023/1024)                         1.00      5.4±0.01µs        ? ?/sec    1.00      5.4±0.01µs        ? ?/sec
filter context i32 w NULLs low selectivity (kept 1/1024)                             1.01    323.3±3.72ns        ? ?/sec    1.00    320.2±2.86ns        ? ?/sec
filter context i32 w NULLs, only valid (kept 1/4)                                    2.17     16.2±0.16µs        ? ?/sec    1.00      7.5±0.02µs        ? ?/sec
filter context i32 w NULLs, only valid high selectivity (kept 1023/2048)             1.58     20.8±0.01µs        ? ?/sec    1.00     13.2±0.02µs        ? ?/sec
filter context i32 w NULLs, only valid low selectivity (kept 1/2048)                 1.75    226.3±0.48ns        ? ?/sec    1.00    129.5±0.54ns        ? ?/sec
filter context list<i32> w NULLs (kept 1/2)                                          1.01   857.5±12.67µs        ? ?/sec    1.00    847.5±6.90µs        ? ?/sec
filter context list<i32> w NULLs high selectivity (kept 1023/1024)                   1.00    157.2±0.33µs        ? ?/sec    1.01    158.7±0.22µs        ? ?/sec
filter context list<i32> w NULLs low selectivity (kept 1/1024)                       1.01      4.9±0.02µs        ? ?/sec    1.00      4.8±0.01µs        ? ?/sec
filter context list<struct<i64, utf8>> w NULLs (kept 1/2)                            1.00      2.1±0.06ms        ? ?/sec    1.00      2.1±0.01ms        ? ?/sec
filter context list<struct<i64, utf8>> w NULLs high selectivity (kept 1023/1024)     1.00      5.6±0.06ms        ? ?/sec    1.00      5.6±0.39ms        ? ?/sec
filter context list<struct<i64, utf8>> w NULLs low selectivity (kept 1/1024)         1.00     10.4±0.02µs        ? ?/sec    1.01     10.5±0.02µs        ? ?/sec
filter context map<utf8, i64> w NULLs (kept 1/2)                                     1.00   1956.6±5.08µs        ? ?/sec    1.02  1998.5±64.02µs        ? ?/sec
filter context map<utf8, i64> w NULLs high selectivity (kept 1023/1024)              1.00      6.0±0.59ms        ? ?/sec    1.09      6.6±0.41ms        ? ?/sec
filter context map<utf8, i64> w NULLs low selectivity (kept 1/1024)                  1.00      9.9±0.03µs        ? ?/sec    1.02     10.1±0.02µs        ? ?/sec
filter context mixed string view w NULLs (kept 1/2)                                  1.00     29.4±0.11µs        ? ?/sec    1.00     29.4±0.05µs        ? ?/sec
filter context mixed string view w NULLs high selectivity (kept 1023/1024)           1.00     21.9±0.48µs        ? ?/sec    1.01     22.2±0.41µs        ? ?/sec
filter context mixed string view w NULLs low selectivity (kept 1/1024)               1.04    336.1±5.74ns        ? ?/sec    1.00    323.3±2.41ns        ? ?/sec
filter context short string view w NULLs (kept 1/2)                                  1.00     29.0±0.09µs        ? ?/sec    1.01     29.3±0.11µs        ? ?/sec
filter context short string view w NULLs high selectivity (kept 1023/1024)           1.04     21.6±0.32µs        ? ?/sec    1.00     20.8±0.42µs        ? ?/sec
filter context short string view w NULLs low selectivity (kept 1/1024)               1.00    321.9±1.54ns        ? ?/sec    1.02    328.2±2.38ns        ? ?/sec
filter context string dictionary w NULLs (kept 1/2)                                  1.00     20.9±0.27µs        ? ?/sec    1.00     20.9±0.01µs        ? ?/sec
filter context string dictionary w NULLs high selectivity (kept 1023/1024)           1.00      5.5±0.01µs        ? ?/sec    1.01      5.5±0.01µs        ? ?/sec
filter context string dictionary w NULLs low selectivity (kept 1/1024)               1.02    392.6±3.79ns        ? ?/sec    1.00    383.2±3.51ns        ? ?/sec
filter context string w NULLs (kept 1/2)                                             1.01   368.7±12.43µs        ? ?/sec    1.00   365.5±11.52µs        ? ?/sec
filter context string w NULLs high selectivity (kept 1023/1024)                      1.00   316.1±13.50µs        ? ?/sec    1.18   373.4±41.57µs        ? ?/sec
filter context string w NULLs low selectivity (kept 1/1024)                          1.01    687.2±6.09ns        ? ?/sec    1.00    677.7±5.13ns        ? ?/sec
filter context u8 w NULLs (kept 1/2)                                                 1.00     20.7±0.04µs        ? ?/sec    1.00     20.6±0.01µs        ? ?/sec
filter context u8 w NULLs high selectivity (kept 1023/1024)                          1.00      2.7±0.02µs        ? ?/sec    1.01      2.7±0.01µs        ? ?/sec
filter context u8 w NULLs low selectivity (kept 1/1024)                              1.00    300.5±2.00ns        ? ?/sec    1.00    300.7±2.80ns        ? ?/sec
filter f32 w NULLs (kept 1/2)                                                        1.00     37.1±0.05µs        ? ?/sec    1.00     36.9±0.06µs        ? ?/sec
filter fixed_size_list<i32> w NULLs (kept 1/2)                                       1.00    684.1±6.08µs        ? ?/sec    1.00    683.4±2.01µs        ? ?/sec
filter fixed_size_list<i32> w NULLs high selectivity (kept 1023/1024)                1.00     72.4±0.13µs        ? ?/sec    1.03     74.5±0.14µs        ? ?/sec
filter fixed_size_list<i32> w NULLs low selectivity (kept 1/1024)                    1.01      4.3±0.01µs        ? ?/sec    1.00      4.3±0.01µs        ? ?/sec
filter fsb with value length 20 w NULLs (kept 1/2)                                   1.06     71.6±0.48µs        ? ?/sec    1.00     67.6±0.71µs        ? ?/sec
filter fsb with value length 20 w NULLs high selectivity (kept 1023/1024)            1.00     24.8±0.10µs        ? ?/sec    1.05     26.1±0.17µs        ? ?/sec
filter fsb with value length 20 w NULLs low selectivity (kept 1/1024)                1.00   1704.4±2.37ns        ? ?/sec    1.02   1731.7±3.16ns        ? ?/sec
filter fsb with value length 5 w NULLs (kept 1/2)                                    1.09     69.4±0.05µs        ? ?/sec    1.00     63.9±0.03µs        ? ?/sec
filter fsb with value length 5 w NULLs high selectivity (kept 1023/1024)             1.00      7.9±0.02µs        ? ?/sec    1.00      7.9±0.03µs        ? ?/sec
filter fsb with value length 5 w NULLs low selectivity (kept 1/1024)                 1.00  1654.3±20.72ns        ? ?/sec    1.01   1667.4±7.81ns        ? ?/sec
filter fsb with value length 50 w NULLs (kept 1/2)                                   1.00    102.6±0.29µs        ? ?/sec    1.02    105.2±0.75µs        ? ?/sec
filter fsb with value length 50 w NULLs high selectivity (kept 1023/1024)            1.06     73.4±6.03µs        ? ?/sec    1.00     68.9±0.47µs        ? ?/sec
filter fsb with value length 50 w NULLs low selectivity (kept 1/1024)                1.00   1701.4±2.83ns        ? ?/sec    1.00   1697.6±2.87ns        ? ?/sec
filter list<i32> w NULLs (kept 1/2)                                                  1.01   851.7±11.21µs        ? ?/sec    1.00    844.8±4.59µs        ? ?/sec
filter list<i32> w NULLs high selectivity (kept 1023/1024)                           1.00    165.7±5.89µs        ? ?/sec    1.00    165.8±1.33µs        ? ?/sec
filter list<i32> w NULLs low selectivity (kept 1/1024)                               1.00      5.0±0.01µs        ? ?/sec    1.00      5.0±0.02µs        ? ?/sec
filter list<struct<i64, utf8>> w NULLs (kept 1/2)                                    1.05      2.2±0.14ms        ? ?/sec    1.00      2.1±0.01ms        ? ?/sec
filter list<struct<i64, utf8>> w NULLs high selectivity (kept 1023/1024)             1.00      5.6±0.06ms        ? ?/sec    1.06      5.9±0.53ms        ? ?/sec
filter list<struct<i64, utf8>> w NULLs low selectivity (kept 1/1024)                 1.00     10.7±0.02µs        ? ?/sec    1.00     10.7±0.02µs        ? ?/sec
filter map<utf8, i64> w NULLs (kept 1/2)                                             1.03      2.1±0.14ms        ? ?/sec    1.00      2.0±0.12ms        ? ?/sec
filter map<utf8, i64> w NULLs high selectivity (kept 1023/1024)                      1.00      5.8±0.42ms        ? ?/sec    1.03      6.0±0.06ms        ? ?/sec
filter map<utf8, i64> w NULLs low selectivity (kept 1/1024)                          1.00     10.1±0.01µs        ? ?/sec    1.02     10.3±0.01µs        ? ?/sec

Per-runner information
filter_kernels — shard 1/1

Node: gk3-benchmark-cluster-nap-mu2kt4to-72b5594a-nx8c

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

uname:

Linux bench-c7122096301-5670-qqqdg 6.12.105+ #1 SMP Sat Sep 19 07:55:25 UTC 2026 aarch64 GNU/Linux

BENCH_COMMAND:

cargo bench --features=arrow,async,test_common,experimental,object_store --bench filter_kernels
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
Resource Usage

base (merge-base)

Metric Value
Wall time 770.2s
Peak memory 76.1 MiB
Avg memory 30.2 MiB
CPU user 736.7s
CPU sys 26.7s
Peak spill 0 B

branch

Metric Value
Wall time 750.2s
Peak memory 76.4 MiB
Avg memory 32.8 MiB
CPU user 718.8s
CPU sys 26.1s
Peak spill 0 B

File an issue against this benchmark runner

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

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

arrow Changes to the arrow crate arrow-kernels Crates that transform arrow data (e.g. compute, cast) arrow-select performance Speed or memory optimizations

Projects

None yet

Development

Successfully merging this pull request may close these issues.

filter: Avoid constructing filter output validity when every selected value is valid

4 participants