Skip to content

perf(speed up filter_fzb) - #10993

Open
Rich-T-kid wants to merge 1 commit into
apache:mainfrom
Rich-T-kid:rich-T-kid/perf-filter-fixed-size-binary-TODO
Open

perf(speed up filter_fzb)#10993
Rich-T-kid wants to merge 1 commit into
apache:mainfrom
Rich-T-kid:rich-T-kid/perf-filter-fixed-size-binary-TODO

Conversation

@Rich-T-kid

@Rich-T-kid Rich-T-kid commented Sep 4, 2026

Copy link
Copy Markdown
Contributor

Which issue does this PR close?

  • Closes none.

Rationale for this change

filter_fixed_size_binary used MutableBuffer::new which zero-initializes
the buffer before immediately overwriting every byte. This skips that.

What changes are included in this PR?

Adds copy_fsb_indices helper used by the IndexIterator and Indices
paths in filter_fixed_size_binary. Swaps MutableBuffer::new +
extend_from_slice for with_capacity + ptr::copy_nonoverlapping.

Are these changes tested?

yes, existing test.

Are there any user-facing changes?

no

@Rich-T-kid

Copy link
Copy Markdown
Contributor Author

run benchmark filter_kernels
env
BENCH_FILTER: fsb

@adriangbot

Copy link
Copy Markdown

Hi @Rich-T-kid, your benchmark configuration could not be parsed (#10993 (comment)).

Error: invalid configuration: invalid type: string "env BENCH_FILTER", expected struct CommentConfig

Usage:

run benchmark <name>           # run specific benchmark(s)
run benchmarks                 # run default suite
run benchmarks <name1> <name2> # run specific benchmarks

Any benchmark name is accepted: bench.sh suite names (e.g. tpch, clickbench_partitioned, wide_schema) and Criterion bench targets (e.g. sql_planner) are resolved automatically. A name that matches neither fails on the runner.

Per-side configuration (run benchmark tpch followed by):

env:
# shared env is inherited by BOTH the build and the run, so build
# flags go here. Builds default to no debuginfo for speed; opt back
# in for hung-job gdb dumps and cap jobs to stay within memory:
CARGO_PROFILE_RELEASE_DEBUG: "1"
CARGO_BUILD_JOBS: "1"
baseline:
ref: v45.0.0
env:
# per-side env only reaches the benchmark run, not the build
DATAFUSION_RUNTIME_MEMORY_LIMIT: 1G
changed:
ref: v46.0.0
env:
DATAFUSION_RUNTIME_MEMORY_LIMIT: 2G

File an issue against this benchmark runner

@Rich-T-kid

Copy link
Copy Markdown
Contributor Author

run benchmark filter_kernels
env:
BENCH_FILTER: fsb

@adriangbot

Copy link
Copy Markdown

🤖 Arrow criterion benchmark running (GKE) | trigger
Instance: c4a-highmem-16 (12 vCPU / 65 GiB) | Linux bench-c5544361897-2136-l6bbj 6.12.94+ #1 SMP Fri Jul 17 09:42:57 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 rich-T-kid/perf-filter-fixed-size-binary-TODO (1e93350) to 3e89669 (merge-base) diff

Run configuration
run benchmark filter_kernels
env:
  BENCH_FILTER: "fsb"

BENCH_COMMAND=cargo bench --features=arrow,async,test_common,experimental,object_store --bench filter_kernels
Results will be posted here when complete


File an issue against this benchmark runner

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

Copy link
Copy Markdown

🤖 Arrow criterion benchmark completed (GKE) | trigger

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

Comparing rich-T-kid/perf-filter-fixed-size-binary-TODO (1e93350) to 3e89669 (merge-base) diff

Run configuration
run benchmark filter_kernels
env:
  BENCH_FILTER: "fsb"
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                                   rich-T-kid_perf-filter-fixed-size-binary-TODO
-----                                                                        ----                                   ---------------------------------------------
filter context fsb with value length 20 (kept 1/2)                           1.00     69.2±0.04µs        ? ?/sec    1.00     69.1±0.13µs        ? ?/sec
filter context fsb with value length 20 high selectivity (kept 1023/1024)    1.00     69.1±0.04µs        ? ?/sec    1.00     69.2±0.14µs        ? ?/sec
filter context fsb with value length 20 low selectivity (kept 1/1024)        1.00     69.1±0.03µs        ? ?/sec    1.00     69.0±0.02µs        ? ?/sec
filter context fsb with value length 5 (kept 1/2)                            1.00     69.2±0.03µs        ? ?/sec    1.00     69.1±0.02µs        ? ?/sec
filter context fsb with value length 5 high selectivity (kept 1023/1024)     1.00     69.1±0.04µs        ? ?/sec    1.00     69.0±0.02µs        ? ?/sec
filter context fsb with value length 5 low selectivity (kept 1/1024)         1.00     69.1±0.07µs        ? ?/sec    1.00     69.0±0.03µs        ? ?/sec
filter context fsb with value length 50 (kept 1/2)                           1.00     69.1±0.07µs        ? ?/sec    1.00     69.0±0.03µs        ? ?/sec
filter context fsb with value length 50 high selectivity (kept 1023/1024)    1.00     69.1±0.08µs        ? ?/sec    1.00     69.0±0.02µs        ? ?/sec
filter context fsb with value length 50 low selectivity (kept 1/1024)        1.00     69.1±0.08µs        ? ?/sec    1.00     69.0±0.02µs        ? ?/sec
filter fsb with value length 20 (kept 1/2)                                   1.34     77.1±0.10µs        ? ?/sec    1.00     57.5±0.06µs        ? ?/sec
filter fsb with value length 20 high selectivity (kept 1023/1024)            1.04     24.2±0.23µs        ? ?/sec    1.00     23.2±0.10µs        ? ?/sec
filter fsb with value length 20 low selectivity (kept 1/1024)                1.00   1784.9±1.82ns        ? ?/sec    1.00   1780.6±1.85ns        ? ?/sec
filter fsb with value length 5 (kept 1/2)                                    1.38     76.5±0.10µs        ? ?/sec    1.00     55.6±0.02µs        ? ?/sec
filter fsb with value length 5 high selectivity (kept 1023/1024)             1.07      6.2±0.01µs        ? ?/sec    1.00      5.8±0.01µs        ? ?/sec
filter fsb with value length 5 low selectivity (kept 1/1024)                 1.03   1767.3±5.12ns        ? ?/sec    1.00   1717.2±1.91ns        ? ?/sec
filter fsb with value length 50 (kept 1/2)                                   1.33    122.1±0.36µs        ? ?/sec    1.00     91.8±0.24µs        ? ?/sec
filter fsb with value length 50 high selectivity (kept 1023/1024)            1.00     72.1±0.69µs        ? ?/sec    1.00     71.8±0.47µs        ? ?/sec
filter fsb with value length 50 low selectivity (kept 1/1024)                1.02   1804.3±2.17ns        ? ?/sec    1.00   1771.5±1.61ns        ? ?/sec

Resource Usage

base (merge-base)

Metric Value
Wall time 180.0s
Peak memory 31.6 MiB
Avg memory 24.7 MiB
CPU user 173.9s
CPU sys 0.0s
Peak spill 0 B

branch

Metric Value
Wall time 175.0s
Peak memory 33.1 MiB
Avg memory 25.6 MiB
CPU user 168.2s
CPU sys 0.0s
Peak spill 0 B

File an issue against this benchmark runner

@Rich-T-kid
Rich-T-kid marked this pull request as ready for review September 4, 2026 18:03
@Rich-T-kid

Copy link
Copy Markdown
Contributor Author
filter fsb with value length 20 (kept 1/2)                                   1.34     77.1±0.10µs        ? ?/sec    1.00     57.5±0.06µs        ? ?/sec
filter fsb with value length 5 (kept 1/2)                                    1.38     76.5±0.10µs        ? ?/sec    1.00     55.6±0.02µs        ? ?/sec
filter fsb with value length 50 (kept 1/2)                                   1.33    122.1±0.36µs        ? ?/sec    1.00     91.8±0.24µs        ? ?/sec

decent wins

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-select

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants