Skip to content

perf(interleave): reuse shared dictionary values - #12059

Open
Rich-T-kid wants to merge 5 commits into
apache:mainfrom
Rich-T-kid:rich-T-kid/interleave-shared-dictionary-values
Open

Rich-T-kid wants to merge 5 commits into
apache:mainfrom
Rich-T-kid:rich-T-kid/interleave-shared-dictionary-values

Conversation

@Rich-T-kid

@Rich-T-kid Rich-T-kid commented Nov 3, 2026 •

Copy link
Copy Markdown
Contributor

Which issue does this PR close?

Part of #12056.

Rationale for this change

interleave currently concatenates dictionary values even when every input uses the same values: the same Arc, or the same buffers in different Arcs, as zip and ArrayData round trips produce. Slices of one dictionary therefore duplicate an unchanged mapping and offset keys that can be reused directly.

input A: keys [0, 2] --+
                         +--> shared values Arc V
input B: keys [1, 0] --+

indices: [(A, 1), (B, 0)]

before: values = concat(V, V)   keys = [2, len(V) + 1]
after:  values = Arc::clone(V)  keys = [2, 1]

One way this reaches Arrow is a DataFusion aggregation over a dictionary-encoded column:

SELECT user_id, array_agg(event_type)
FROM events
WHERE event_time >= TIMESTAMP '2026-01-01'
GROUP BY user_id;

A typical multi-partition physical plan is:

AggregateExec: mode=FinalPartitioned
  RepartitionExec: Hash(user_id)
    AggregateExec: mode=Partial       <-- first array_agg accumulator
      FilterExec
        DataSourceExec

DictionaryArray::slice slices the keys but clones the values Arc. The dictionary filter and take paths behave the same way:

scan batch: Dictionary(keys, Arc V)
              |
              +-- slice/filter --> Dictionary(keys_0, Arc V)
              +-- slice/filter --> Dictionary(keys_1, Arc V)
              +-- slice/filter --> Dictionary(keys_2, Arc V)

In the partial AggregateExec, DataFusion's ArrayAggGroupsAccumulator follows this path:

update_batch
  retain each input ArrayRef
  retain (group_idx, row_idx) for each row
        |
        v
evaluate / state
  counting-sort the row references by group
  build [(batch_idx, row_idx)]
        |
        v
arrow::compute::interleave(&sources, &indices)

When several input batches were sliced or filtered from the same dictionary, the partial aggregate therefore passes their different key buffers backed by the same Arc V directly to interleave. The final aggregate can call the same accumulator path again when it merges the partial list states, although whether those mappings still share an Arc depends on the inputs.

DataFusion's sort merge path also calls interleave for each output column. With RLE-to-dictionary decoding enabled, the best query-level candidates are ClickBench Q23-Q26, TPC-H Q2/Q10/Q16, and TPC-DS Q10/Q12/Q18/Q20/Q43/Q62/Q91/Q98/Q99. These queries sort or merge filtered, joined, or grouped rows while carrying dictionary-friendly string columns, so their batches can have different key buffers backed by the same values Arc. These are expected candidates rather than measured suite results.

What changes are included in this PR?

When every input's values array is the same Arc or, for byte and primitive values, has the same buffers and null buffer, interleave keeps the first input's values and interleaves the keys directly. Key nulls are preserved. This check includes inputs that contribute no selected valid key, so an unused or all-null input with a different values mapping keeps the existing fallback. The merge path now builds its value masks in one pass over the selected indices.

Are these changes tested?

The tests cover shared-values reuse through the same Arc, ArrayData round trips for UTF-8 and Int64 values, and Utf8View reuse. They also cover original key and null preservation, empty values arrays, and artificial key overflow, and verify that distinct mappings still report key overflow.

Benchmark Result Run
interleave dict Shared mappings are 1.6-4.1x faster, and the distinct cases range from 1% slower to 5% faster. final

Are there any significant user-facing changes?

No.

@Rich-T-kid

Copy link
Copy Markdown
Contributor Author

run benchmark interleave_kernels
env:
BENCH_FILTER: "interleave dict"

2 similar comments
@Rich-T-kid

Copy link
Copy Markdown
Contributor Author

run benchmark interleave_kernels
env:
BENCH_FILTER: "interleave dict"

@Rich-T-kid

Copy link
Copy Markdown
Contributor Author

run benchmark interleave_kernels
env:
BENCH_FILTER: "interleave dict"

@adriangbot

Copy link
Copy Markdown

🤖 Benchmark starting (GKE) | trigger

Target: interleave_kernels

Sharding factor: 1 (1 workers).

Comparing rich-T-kid/interleave-shared-dictionary-values (042914e) to 8e9eec3 (merge-base) diff

Run configuration
run benchmark interleave_kernels
env:
  BENCH_FILTER: interleave dict
shards: 1

Results will be posted when all workers finish.


File an issue against this benchmark runner

@adriangbot

Copy link
Copy Markdown

🤖 Benchmark starting (GKE) | trigger

Target: interleave_kernels

Sharding factor: 1 (1 workers).

Comparing rich-T-kid/interleave-shared-dictionary-values (042914e) to 8e9eec3 (merge-base) diff

Run configuration
run benchmark interleave_kernels
env:
  BENCH_FILTER: interleave dict
shards: 1

Results will be posted when all workers finish.


File an issue against this benchmark runner

@adriangbot

Copy link
Copy Markdown

🤖 Benchmark completed (GKE) | trigger

Target: interleave_kernels

Comparing rich-T-kid/interleave-shared-dictionary-values (042914e) to 8e9eec3 (merge-base) diff

Run configuration
run benchmark interleave_kernels
env:
  BENCH_FILTER: interleave dict
shards: 1
Details
group                                                                          base                                   changed
-----                                                                          ----                                   -------
interleave dict(20, 0.0) 100 [0..100, 100..230, 450..1000]                     1.68    627.5±2.93ns        ? ?/sec    1.00    373.6±1.37ns        ? ?/sec
interleave dict(20, 0.0) 1024 [0..100, 100..230, 450..1000, 0..1000]           1.00   1812.9±6.82ns        ? ?/sec    1.61      2.9±0.02µs        ? ?/sec
interleave dict(20, 0.0) 1024 [0..100, 100..230, 450..1000]                    1.00   1787.1±8.69ns        ? ?/sec    1.62      2.9±0.02µs        ? ?/sec
interleave dict(20, 0.0) 400 [0..100, 100..230, 450..1000]                     1.00   1019.3±3.50ns        ? ?/sec    1.02   1039.7±1.17ns        ? ?/sec
interleave dict_distinct 100                                                   1.00   1979.1±4.55ns        ? ?/sec    1.00   1980.7±5.69ns        ? ?/sec
interleave dict_distinct 1024                                                  1.00      6.2±0.01µs        ? ?/sec    1.00      6.2±0.02µs        ? ?/sec
interleave dict_distinct 2048                                                  1.00      3.5±0.02µs        ? ?/sec    1.00      3.5±0.01µs        ? ?/sec
interleave dict_sparse(20, 0.0) 100 [0..100, 100..230, 450..1000]              4.07   1516.6±4.46ns        ? ?/sec    1.00    373.0±1.19ns        ? ?/sec
interleave dict_sparse(20, 0.0) 1024 [0..100, 100..230, 450..1000, 0..1000]    1.19      3.0±0.01µs        ? ?/sec    1.00      2.6±0.06µs        ? ?/sec
interleave dict_sparse(20, 0.0) 1024 [0..100, 100..230, 450..1000]             1.19      2.7±0.01µs        ? ?/sec    1.00      2.3±0.01µs        ? ?/sec
interleave dict_sparse(20, 0.0) 400 [0..100, 100..230, 450..1000]              1.87   1937.4±4.06ns        ? ?/sec    1.00   1033.9±1.21ns        ? ?/sec

Per-runner information
interleave_kernels — shard 1/1

Node: gk3-benchmark-cluster-nap-r578ggp2-e53cf964-kmcq

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

uname:

Linux bench-c6612324441-4331-hjzdd 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 interleave_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 105.0s
Peak memory 18.6 MiB
Avg memory 16.9 MiB
CPU user 100.8s
CPU sys 0.0s
Peak spill 0 B

branch

Metric Value
Wall time 105.0s
Peak memory 18.4 MiB
Avg memory 16.5 MiB
CPU user 99.1s
CPU sys 0.0s
Peak spill 0 B

File an issue against this benchmark runner

@adriangbot

Copy link
Copy Markdown

🤖 Benchmark starting (GKE) | trigger

Target: interleave_kernels

Sharding factor: 1 (1 workers).

Comparing rich-T-kid/interleave-shared-dictionary-values (042914e) to 8e9eec3 (merge-base) diff

Run configuration
run benchmark interleave_kernels
env:
  BENCH_FILTER: interleave dict
shards: 1

Results will be posted when all workers finish.


File an issue against this benchmark runner

@adriangbot

Copy link
Copy Markdown

🤖 Benchmark completed (GKE) | trigger

Target: interleave_kernels

Comparing rich-T-kid/interleave-shared-dictionary-values (042914e) to 8e9eec3 (merge-base) diff

Run configuration
run benchmark interleave_kernels
env:
  BENCH_FILTER: interleave dict
shards: 1
Details
group                                                                          base                                   changed
-----                                                                          ----                                   -------
interleave dict(20, 0.0) 100 [0..100, 100..230, 450..1000]                     1.72    642.3±5.23ns        ? ?/sec    1.00    373.3±1.07ns        ? ?/sec
interleave dict(20, 0.0) 1024 [0..100, 100..230, 450..1000, 0..1000]           1.00  1830.3±12.12ns        ? ?/sec    1.59      2.9±0.02µs        ? ?/sec
interleave dict(20, 0.0) 1024 [0..100, 100..230, 450..1000]                    1.00   1797.1±7.92ns        ? ?/sec    1.62      2.9±0.02µs        ? ?/sec
interleave dict(20, 0.0) 400 [0..100, 100..230, 450..1000]                     1.00   1033.9±6.28ns        ? ?/sec    1.00   1038.8±1.22ns        ? ?/sec
interleave dict_distinct 100                                                   1.02      2.0±0.00µs        ? ?/sec    1.00   1987.2±2.69ns        ? ?/sec
interleave dict_distinct 1024                                                  1.01      6.3±0.01µs        ? ?/sec    1.00      6.2±0.01µs        ? ?/sec
interleave dict_distinct 2048                                                  1.00      3.5±0.02µs        ? ?/sec    1.00      3.5±0.01µs        ? ?/sec
interleave dict_sparse(20, 0.0) 100 [0..100, 100..230, 450..1000]              4.10   1525.2±4.49ns        ? ?/sec    1.00    372.4±0.92ns        ? ?/sec
interleave dict_sparse(20, 0.0) 1024 [0..100, 100..230, 450..1000, 0..1000]    1.20      3.1±0.02µs        ? ?/sec    1.00      2.6±0.05µs        ? ?/sec
interleave dict_sparse(20, 0.0) 1024 [0..100, 100..230, 450..1000]             1.19      2.7±0.00µs        ? ?/sec    1.00      2.3±0.01µs        ? ?/sec
interleave dict_sparse(20, 0.0) 400 [0..100, 100..230, 450..1000]              1.89   1956.2±4.99ns        ? ?/sec    1.00   1035.4±1.05ns        ? ?/sec

Per-runner information
interleave_kernels — shard 1/1

Node: gk3-benchmark-cluster-nap-r578ggp2-e53cf964-dhgd

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

uname:

Linux bench-c6612324049-4332-2bz7b 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 interleave_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 110.0s
Peak memory 18.8 MiB
Avg memory 16.4 MiB
CPU user 101.8s
CPU sys 0.0s
Peak spill 0 B

branch

Metric Value
Wall time 105.0s
Peak memory 18.4 MiB
Avg memory 16.5 MiB
CPU user 99.1s
CPU sys 0.0s
Peak spill 0 B

File an issue against this benchmark runner

@Rich-T-kid

Copy link
Copy Markdown
Contributor Author

run benchmark interleave_kernels
env:
BENCH_FILTER: "interleave dict"

@adriangbot

Copy link
Copy Markdown

🤖 Benchmark starting (GKE) | trigger

Target: interleave_kernels

Sharding factor: 1 (1 workers).

Comparing rich-T-kid/interleave-shared-dictionary-values (042914e) to 8e9eec3 (merge-base) diff

Run configuration
run benchmark interleave_kernels
env:
  BENCH_FILTER: interleave dict
shards: 1

Results will be posted when all workers finish.


File an issue against this benchmark runner

@adriangbot

Copy link
Copy Markdown

🤖 Benchmark completed (GKE) | trigger

Target: interleave_kernels

Comparing rich-T-kid/interleave-shared-dictionary-values (042914e) to 8e9eec3 (merge-base) diff

Run configuration
run benchmark interleave_kernels
env:
  BENCH_FILTER: interleave dict
shards: 1
Details
group                                                                          base                                   changed
-----                                                                          ----                                   -------
interleave dict(20, 0.0) 100 [0..100, 100..230, 450..1000]                     1.69    632.1±3.90ns        ? ?/sec    1.00    373.4±0.97ns        ? ?/sec
interleave dict(20, 0.0) 1024 [0..100, 100..230, 450..1000, 0..1000]           1.00   1819.0±3.52ns        ? ?/sec    1.61      2.9±0.02µs        ? ?/sec
interleave dict(20, 0.0) 1024 [0..100, 100..230, 450..1000]                    1.00   1796.2±9.05ns        ? ?/sec    1.62      2.9±0.01µs        ? ?/sec
interleave dict(20, 0.0) 400 [0..100, 100..230, 450..1000]                     1.00   1039.2±2.69ns        ? ?/sec    1.00   1039.2±0.81ns        ? ?/sec
interleave dict_distinct 100                                                   1.00   1975.4±7.79ns        ? ?/sec    1.01   1985.5±4.14ns        ? ?/sec
interleave dict_distinct 1024                                                  1.00      6.2±0.01µs        ? ?/sec    1.00      6.2±0.02µs        ? ?/sec
interleave dict_distinct 2048                                                  1.01      3.5±0.03µs        ? ?/sec    1.00      3.5±0.02µs        ? ?/sec
interleave dict_sparse(20, 0.0) 100 [0..100, 100..230, 450..1000]              4.09   1522.8±4.33ns        ? ?/sec    1.00    372.6±0.60ns        ? ?/sec
interleave dict_sparse(20, 0.0) 1024 [0..100, 100..230, 450..1000, 0..1000]    1.19      3.0±0.01µs        ? ?/sec    1.00      2.6±0.05µs        ? ?/sec
interleave dict_sparse(20, 0.0) 1024 [0..100, 100..230, 450..1000]             1.19      2.7±0.01µs        ? ?/sec    1.00      2.3±0.01µs        ? ?/sec
interleave dict_sparse(20, 0.0) 400 [0..100, 100..230, 450..1000]              1.86   1926.1±4.40ns        ? ?/sec    1.00   1033.0±4.11ns        ? ?/sec

Per-runner information
interleave_kernels — shard 1/1

Node: gk3-benchmark-cluster-nap-r578ggp2-e53cf964-kmcq

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

uname:

Linux bench-c6612325162-4333-jlfql 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 interleave_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 110.0s
Peak memory 18.6 MiB
Avg memory 16.3 MiB
CPU user 101.0s
CPU sys 0.0s
Peak spill 0 B

branch

Metric Value
Wall time 105.0s
Peak memory 18.4 MiB
Avg memory 16.5 MiB
CPU user 99.1s
CPU sys 0.0s
Peak spill 0 B

File an issue against this benchmark runner

@adriangbot

Copy link
Copy Markdown

🤖 Benchmark completed (GKE) | trigger

Target: interleave_kernels

Comparing rich-T-kid/interleave-shared-dictionary-values (042914e) to 8e9eec3 (merge-base) diff

Run configuration
run benchmark interleave_kernels
env:
  BENCH_FILTER: interleave dict
shards: 1
Details
group                                                                          base                                   changed
-----                                                                          ----                                   -------
interleave dict(20, 0.0) 100 [0..100, 100..230, 450..1000]                     1.72    641.8±2.81ns        ? ?/sec    1.00    373.1±0.73ns        ? ?/sec
interleave dict(20, 0.0) 1024 [0..100, 100..230, 450..1000, 0..1000]           1.00  1829.2±11.17ns        ? ?/sec    1.59      2.9±0.02µs        ? ?/sec
interleave dict(20, 0.0) 1024 [0..100, 100..230, 450..1000]                    1.00   1798.4±7.43ns        ? ?/sec    1.61      2.9±0.02µs        ? ?/sec
interleave dict(20, 0.0) 400 [0..100, 100..230, 450..1000]                     1.00   1030.7±3.18ns        ? ?/sec    1.01   1039.1±0.92ns        ? ?/sec
interleave dict_distinct 100                                                   1.00      2.0±0.00µs        ? ?/sec    1.00      2.0±0.01µs        ? ?/sec
interleave dict_distinct 1024                                                  1.01      6.2±0.02µs        ? ?/sec    1.00      6.2±0.02µs        ? ?/sec
interleave dict_distinct 2048                                                  1.01      3.5±0.01µs        ? ?/sec    1.00      3.5±0.01µs        ? ?/sec
interleave dict_sparse(20, 0.0) 100 [0..100, 100..230, 450..1000]              4.08   1530.8±4.40ns        ? ?/sec    1.00    375.1±2.16ns        ? ?/sec
interleave dict_sparse(20, 0.0) 1024 [0..100, 100..230, 450..1000, 0..1000]    1.20      3.1±0.01µs        ? ?/sec    1.00      2.6±0.06µs        ? ?/sec
interleave dict_sparse(20, 0.0) 1024 [0..100, 100..230, 450..1000]             1.19      2.7±0.01µs        ? ?/sec    1.00      2.3±0.01µs        ? ?/sec
interleave dict_sparse(20, 0.0) 400 [0..100, 100..230, 450..1000]              1.88   1948.0±4.95ns        ? ?/sec    1.00   1035.5±2.36ns        ? ?/sec

Per-runner information
interleave_kernels — shard 1/1

Node: gk3-benchmark-cluster-nap-r578ggp2-e53cf964-sc8v

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

uname:

Linux bench-c6612637201-4336-97rdb 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 interleave_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 105.0s
Peak memory 18.6 MiB
Avg memory 17.1 MiB
CPU user 101.9s
CPU sys 0.0s
Peak spill 0 B

branch

Metric Value
Wall time 105.0s
Peak memory 18.4 MiB
Avg memory 17.0 MiB
CPU user 102.1s
CPU sys 0.0s
Peak spill 0 B

File an issue against this benchmark runner

@Rich-T-kid

Copy link
Copy Markdown
Contributor Author

run benchmark interleave_kernels
env:
BENCH_FILTER: "interleave dict"

@adriangbot

Copy link
Copy Markdown

🤖 Benchmark starting (GKE) | trigger

Target: interleave_kernels

Sharding factor: 1 (1 workers).

Comparing rich-T-kid/interleave-shared-dictionary-values (fb8c26d) to 8e9eec3 (merge-base) diff

Run configuration
run benchmark interleave_kernels
env:
  BENCH_FILTER: interleave dict
shards: 1

Results will be posted when all workers finish.


File an issue against this benchmark runner

@github-actions github-actions Bot added the arrow-kernels Crates that transform arrow data (e.g. compute, cast) label Nov 3, 2026
@adriangbot

Copy link
Copy Markdown

🤖 Benchmark completed (GKE) | trigger

Target: interleave_kernels

Comparing rich-T-kid/interleave-shared-dictionary-values (fb8c26d) to 8e9eec3 (merge-base) diff

Run configuration
run benchmark interleave_kernels
env:
  BENCH_FILTER: interleave dict
shards: 1
Details
group                                                                          base                                   changed
-----                                                                          ----                                   -------
interleave dict(20, 0.0) 100 [0..100, 100..230, 450..1000]                     1.92   639.9±12.80ns        ? ?/sec    1.00    332.5±2.50ns        ? ?/sec
interleave dict(20, 0.0) 1024 [0..100, 100..230, 450..1000, 0..1000]           1.59  1825.8±12.09ns        ? ?/sec    1.00   1150.2±4.68ns        ? ?/sec
interleave dict(20, 0.0) 1024 [0..100, 100..230, 450..1000]                    1.55  1802.3±14.80ns        ? ?/sec    1.00   1162.6±3.16ns        ? ?/sec
interleave dict(20, 0.0) 400 [0..100, 100..230, 450..1000]                     1.66  1033.8±11.92ns        ? ?/sec    1.00    622.8±3.41ns        ? ?/sec
interleave dict_distinct 100                                                   1.00   1967.2±3.84ns        ? ?/sec    1.02      2.0±0.01µs        ? ?/sec
interleave dict_distinct 1024                                                  1.00      6.2±0.01µs        ? ?/sec    1.05      6.5±0.02µs        ? ?/sec
interleave dict_distinct 2048                                                  1.00      3.5±0.02µs        ? ?/sec    1.00      3.5±0.02µs        ? ?/sec
interleave dict_sparse(20, 0.0) 100 [0..100, 100..230, 450..1000]              4.61  1529.3±11.29ns        ? ?/sec    1.00    332.0±3.78ns        ? ?/sec
interleave dict_sparse(20, 0.0) 1024 [0..100, 100..230, 450..1000, 0..1000]    2.64      3.1±0.01µs        ? ?/sec    1.00   1155.9±4.67ns        ? ?/sec
interleave dict_sparse(20, 0.0) 1024 [0..100, 100..230, 450..1000]             2.44      2.7±0.01µs        ? ?/sec    1.00   1123.1±4.69ns        ? ?/sec
interleave dict_sparse(20, 0.0) 400 [0..100, 100..230, 450..1000]              3.27  1939.5±12.35ns        ? ?/sec    1.00    593.5±4.07ns        ? ?/sec

Per-runner information
interleave_kernels — shard 1/1

Node: gk3-benchmark-cluster-nap-1uq9xv30-f6f148e3-8kvx

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

uname:

Linux bench-c6613674796-4346-9w7t6 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 interleave_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 105.0s
Peak memory 18.6 MiB
Avg memory 17.1 MiB
CPU user 101.7s
CPU sys 0.0s
Peak spill 0 B

branch

Metric Value
Wall time 110.0s
Peak memory 18.5 MiB
Avg memory 17.1 MiB
CPU user 108.1s
CPU sys 0.0s
Peak spill 0 B

File an issue against this benchmark runner

@Rich-T-kid

Copy link
Copy Markdown
Contributor Author

run benchmark interleave_kernels
env:
BENCH_FILTER: "interleave dict"

@adriangbot

Copy link
Copy Markdown

🤖 Benchmark starting (GKE) | trigger

Target: interleave_kernels

Sharding factor: 1 (1 workers).

Comparing rich-T-kid/interleave-shared-dictionary-values (fb8c26d) to 8e9eec3 (merge-base) diff

Run configuration
run benchmark interleave_kernels
env:
  BENCH_FILTER: interleave dict
shards: 1

Results will be posted when all workers finish.


File an issue against this benchmark runner

@adriangbot

Copy link
Copy Markdown

🤖 Benchmark completed (GKE) | trigger

Target: interleave_kernels

Comparing rich-T-kid/interleave-shared-dictionary-values (fb8c26d) to 8e9eec3 (merge-base) diff

Run configuration
run benchmark interleave_kernels
env:
  BENCH_FILTER: interleave dict
shards: 1
Details
group                                                                          base                                   changed
-----                                                                          ----                                   -------
interleave dict(20, 0.0) 100 [0..100, 100..230, 450..1000]                     1.93    636.9±4.75ns        ? ?/sec    1.00    330.2±1.03ns        ? ?/sec
interleave dict(20, 0.0) 1024 [0..100, 100..230, 450..1000, 0..1000]           1.57   1812.3±4.86ns        ? ?/sec    1.00   1152.7±2.18ns        ? ?/sec
interleave dict(20, 0.0) 1024 [0..100, 100..230, 450..1000]                    1.53   1789.2±5.20ns        ? ?/sec    1.00   1166.7±2.15ns        ? ?/sec
interleave dict(20, 0.0) 400 [0..100, 100..230, 450..1000]                     1.67  1034.8±44.66ns        ? ?/sec    1.00    619.8±1.84ns        ? ?/sec
interleave dict_distinct 100                                                   1.00   1976.6±3.46ns        ? ?/sec    1.00   1981.2±2.87ns        ? ?/sec
interleave dict_distinct 1024                                                  1.00      6.3±0.02µs        ? ?/sec    1.03      6.4±0.02µs        ? ?/sec
interleave dict_distinct 2048                                                  1.00      3.5±0.02µs        ? ?/sec    1.01      3.5±0.03µs        ? ?/sec
interleave dict_sparse(20, 0.0) 100 [0..100, 100..230, 450..1000]              4.65   1519.2±5.19ns        ? ?/sec    1.00    326.8±1.18ns        ? ?/sec
interleave dict_sparse(20, 0.0) 1024 [0..100, 100..230, 450..1000, 0..1000]    2.65      3.1±0.01µs        ? ?/sec    1.00   1150.4±1.74ns        ? ?/sec
interleave dict_sparse(20, 0.0) 1024 [0..100, 100..230, 450..1000]             2.44      2.7±0.01µs        ? ?/sec    1.00   1117.1±1.62ns        ? ?/sec
interleave dict_sparse(20, 0.0) 400 [0..100, 100..230, 450..1000]              3.31   1944.1±6.09ns        ? ?/sec    1.00    587.6±1.67ns        ? ?/sec

Per-runner information
interleave_kernels — shard 1/1

Node: gk3-benchmark-cluster-nap-ho9aygeh-38c2db3b-mkpc

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

uname:

Linux bench-c6613878660-4351-w8bk2 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 interleave_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 105.0s
Peak memory 18.6 MiB
Avg memory 17.1 MiB
CPU user 101.8s
CPU sys 0.0s
Peak spill 0 B

branch

Metric Value
Wall time 110.0s
Peak memory 18.5 MiB
Avg memory 17.1 MiB
CPU user 108.1s
CPU sys 0.0s
Peak spill 0 B

File an issue against this benchmark runner

@Rich-T-kid
Rich-T-kid force-pushed the rich-T-kid/interleave-shared-dictionary-values branch from fb8c26d to 491c626 Compare November 3, 2026 20:06
@Rich-T-kid

Copy link
Copy Markdown
Contributor Author

run benchmark interleave_kernels
env:
BENCH_FILTER: "interleave dict"

@adriangbot

Copy link
Copy Markdown

🤖 Benchmark starting (GKE) | trigger

Target: interleave_kernels

Sharding factor: 1 (1 workers).

Comparing rich-T-kid/interleave-shared-dictionary-values (491c626) to 8e9eec3 (merge-base) diff

Run configuration
run benchmark interleave_kernels
env:
  BENCH_FILTER: interleave dict
shards: 1

Results will be posted when all workers finish.


File an issue against this benchmark runner

@adriangbot

Copy link
Copy Markdown

🤖 Benchmark completed (GKE) | trigger

Target: interleave_kernels

Comparing rich-T-kid/interleave-shared-dictionary-values (491c626) to 8e9eec3 (merge-base) diff

Run configuration
run benchmark interleave_kernels
env:
  BENCH_FILTER: interleave dict
shards: 1
Details
group                                                                          base                                   changed
-----                                                                          ----                                   -------
interleave dict(20, 0.0) 100 [0..100, 100..230, 450..1000]                     1.92    628.7±4.97ns        ? ?/sec    1.00    328.0±1.24ns        ? ?/sec
interleave dict(20, 0.0) 1024 [0..100, 100..230, 450..1000, 0..1000]           1.59   1819.6±9.98ns        ? ?/sec    1.00   1144.2±1.85ns        ? ?/sec
interleave dict(20, 0.0) 1024 [0..100, 100..230, 450..1000]                    1.54   1789.0±9.87ns        ? ?/sec    1.00   1162.3±1.37ns        ? ?/sec
interleave dict(20, 0.0) 400 [0..100, 100..230, 450..1000]                     1.67   1024.5±5.62ns        ? ?/sec    1.00    615.2±1.93ns        ? ?/sec
interleave dict_distinct 100                                                   1.00   1977.9±4.84ns        ? ?/sec    1.01   1999.8±8.81ns        ? ?/sec
interleave dict_distinct 1024                                                  1.00      6.2±0.01µs        ? ?/sec    1.04      6.4±0.01µs        ? ?/sec
interleave dict_distinct 2048                                                  1.00      3.5±0.02µs        ? ?/sec    1.00      3.5±0.01µs        ? ?/sec
interleave dict_sparse(20, 0.0) 100 [0..100, 100..230, 450..1000]              4.71   1529.6±5.49ns        ? ?/sec    1.00    324.9±1.35ns        ? ?/sec
interleave dict_sparse(20, 0.0) 1024 [0..100, 100..230, 450..1000, 0..1000]    2.68      3.1±0.01µs        ? ?/sec    1.00   1142.7±2.03ns        ? ?/sec
interleave dict_sparse(20, 0.0) 1024 [0..100, 100..230, 450..1000]             2.47      2.7±0.01µs        ? ?/sec    1.00   1108.8±2.02ns        ? ?/sec
interleave dict_sparse(20, 0.0) 400 [0..100, 100..230, 450..1000]              3.35   1938.6±8.07ns        ? ?/sec    1.00    578.6±1.91ns        ? ?/sec

Per-runner information
interleave_kernels — shard 1/1

Node: gk3-benchmark-cluster-nap-1kq6y1fb-9a2249d4-x8n8

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

uname:

Linux bench-c6614233356-4352-q4587 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 interleave_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 105.0s
Peak memory 18.6 MiB
Avg memory 17.1 MiB
CPU user 101.8s
CPU sys 0.0s
Peak spill 0 B

branch

Metric Value
Wall time 110.0s
Peak memory 18.5 MiB
Avg memory 17.1 MiB
CPU user 108.1s
CPU sys 0.0s
Peak spill 0 B

File an issue against this benchmark runner

@Rich-T-kid
Rich-T-kid force-pushed the rich-T-kid/interleave-shared-dictionary-values branch from 491c626 to 65a3b88 Compare November 3, 2026 20:28
@Rich-T-kid

Copy link
Copy Markdown
Contributor Author

run benchmark interleave_kernels
env:
BENCH_FILTER: "interleave dict"

@adriangbot

Copy link
Copy Markdown

🤖 Benchmark starting (GKE) | trigger

Target: interleave_kernels

Sharding factor: 1 (1 workers).

Comparing rich-T-kid/interleave-shared-dictionary-values (65a3b88) to 8e9eec3 (merge-base) diff

Run configuration
run benchmark interleave_kernels
env:
  BENCH_FILTER: interleave dict
shards: 1

Results will be posted when all workers finish.


File an issue against this benchmark runner

@adriangbot

Copy link
Copy Markdown

🤖 Benchmark completed (GKE) | trigger

Target: interleave_kernels

Comparing rich-T-kid/interleave-shared-dictionary-values (65a3b88) to 8e9eec3 (merge-base) diff

Run configuration
run benchmark interleave_kernels
env:
  BENCH_FILTER: interleave dict
shards: 1
Details
group                                                                          base                                   changed
-----                                                                          ----                                   -------
interleave dict(20, 0.0) 100 [0..100, 100..230, 450..1000]                     1.89    632.1±4.42ns        ? ?/sec    1.00    334.1±3.32ns        ? ?/sec
interleave dict(20, 0.0) 1024 [0..100, 100..230, 450..1000, 0..1000]           1.57   1816.1±9.13ns        ? ?/sec    1.00   1154.5±4.92ns        ? ?/sec
interleave dict(20, 0.0) 1024 [0..100, 100..230, 450..1000]                    1.54   1788.9±9.27ns        ? ?/sec    1.00   1161.4±5.48ns        ? ?/sec
interleave dict(20, 0.0) 400 [0..100, 100..230, 450..1000]                     1.65   1022.8±4.46ns        ? ?/sec    1.00    619.7±4.47ns        ? ?/sec
interleave dict_distinct 100                                                   1.00   1984.0±4.25ns        ? ?/sec    1.03      2.0±0.03µs        ? ?/sec
interleave dict_distinct 1024                                                  1.00      6.2±0.02µs        ? ?/sec    1.09      6.8±0.03µs        ? ?/sec
interleave dict_distinct 2048                                                  1.00      3.5±0.02µs        ? ?/sec    1.01      3.5±0.02µs        ? ?/sec
interleave dict_sparse(20, 0.0) 100 [0..100, 100..230, 450..1000]              4.61   1525.0±6.48ns        ? ?/sec    1.00    330.9±3.23ns        ? ?/sec
interleave dict_sparse(20, 0.0) 1024 [0..100, 100..230, 450..1000, 0..1000]    2.65      3.1±0.02µs        ? ?/sec    1.00   1153.9±5.19ns        ? ?/sec
interleave dict_sparse(20, 0.0) 1024 [0..100, 100..230, 450..1000]             2.46      2.7±0.01µs        ? ?/sec    1.00   1117.9±4.52ns        ? ?/sec
interleave dict_sparse(20, 0.0) 400 [0..100, 100..230, 450..1000]              3.31   1946.6±6.92ns        ? ?/sec    1.00    588.3±2.96ns        ? ?/sec

Per-runner information
interleave_kernels — shard 1/1

Node: gk3-benchmark-cluster-nap-46uk5hbn-407a41b6-55rv

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

uname:

Linux bench-c6614683567-4365-m798t 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 interleave_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 105.0s
Peak memory 18.6 MiB
Avg memory 17.1 MiB
CPU user 101.7s
CPU sys 0.0s
Peak spill 0 B

branch

Metric Value
Wall time 110.0s
Peak memory 18.5 MiB
Avg memory 17.1 MiB
CPU user 108.1s
CPU sys 0.0s
Peak spill 0 B

File an issue against this benchmark runner

@Rich-T-kid Rich-T-kid changed the title WIP: Reuse shared dictionary values in interleave perf(interleave): reuse shared dictionary values Nov 3, 2026
@Rich-T-kid
Rich-T-kid marked this pull request as ready for review November 3, 2026 20:46
@Rich-T-kid
Rich-T-kid force-pushed the rich-T-kid/interleave-shared-dictionary-values branch from 65a3b88 to ee94246 Compare November 3, 2026 20:51

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

@Rich-T-kid thanks for this. Reusing the values Arc when every input shares it is a clear win (2.04 → 1.08 µs for two slices locally, matching the bot runs). I'd like the referenced-input scan dropped from this PR, since it slows down inputs with distinct mappings (details in the thread on referenced_shared_dictionary_values), plus one missing test.

Once the scan is gone, could you update the description to match? Its "What changes" paragraph and test list still describe ignoring unused and all-null inputs.

Comment thread arrow-select/src/interleave.rs Resolved
Comment thread arrow-select/src/interleave.rs Resolved
@Rich-T-kid
Rich-T-kid marked this pull request as draft November 22, 2026 05:24
@Rich-T-kid
Rich-T-kid force-pushed the rich-T-kid/interleave-shared-dictionary-values branch from 20a68ff to ff3010e Compare November 22, 2026 17:40
@boring-cyborg boring-cyborg Bot added the arrow-core Core crates related to representing arrow data label Nov 22, 2026
@Rich-T-kid

Copy link
Copy Markdown
Contributor Author

run benchmark interleave_kernels
env:
BENCH_FILTER: "interleave dict"
baseline:
ref: "4661ae77c184d470f5c6fe65ecf5a373f73f8c98"
changed:
ref: "ff3010e071d7a6aa3e8a829e01c1dae7c64f1715"

@adriangbot

Copy link
Copy Markdown

🤖 Benchmark starting (GKE) | trigger

Target: interleave_kernels

Sharding factor: 1 (1 workers).

Comparing ff3010e (ff3010e) to 4661ae7 diff

Run configuration
run benchmark interleave_kernels
baseline:
  ref: 4661ae77c184d470f5c6fe65ecf5a373f73f8c98
changed:
  ref: ff3010e071d7a6aa3e8a829e01c1dae7c64f1715
env:
  BENCH_FILTER: interleave dict
shards: 1

Results will be posted when all workers finish.


File an issue against this benchmark runner

@adriangbot

Copy link
Copy Markdown

🤖 Benchmark completed (GKE) | trigger

Target: interleave_kernels

Comparing ff3010e (ff3010e) to 4661ae7 diff

Run configuration
run benchmark interleave_kernels
baseline:
  ref: 4661ae77c184d470f5c6fe65ecf5a373f73f8c98
changed:
  ref: ff3010e071d7a6aa3e8a829e01c1dae7c64f1715
env:
  BENCH_FILTER: interleave dict
shards: 1
Details
group                                                                          base                                   changed
-----                                                                          ----                                   -------
interleave dict(20, 0.0) 100 [0..100, 100..230, 450..1000]                     1.60    632.8±2.91ns        ? ?/sec    1.00    396.1±3.40ns        ? ?/sec
interleave dict(20, 0.0) 1024 [0..100, 100..230, 450..1000, 0..1000]           1.54  1860.3±17.33ns        ? ?/sec    1.00   1211.7±3.04ns        ? ?/sec
interleave dict(20, 0.0) 1024 [0..100, 100..230, 450..1000]                    1.52   1858.7±3.65ns        ? ?/sec    1.00   1221.2±3.87ns        ? ?/sec
interleave dict(20, 0.0) 400 [0..100, 100..230, 450..1000]                     1.63   1090.2±4.55ns        ? ?/sec    1.00    669.9±3.13ns        ? ?/sec
interleave dict_distinct 100                                                   1.00      2.2±0.01µs        ? ?/sec    1.02      2.2±0.01µs        ? ?/sec
interleave dict_distinct 1024                                                  1.03      6.9±0.01µs        ? ?/sec    1.00      6.7±0.01µs        ? ?/sec
interleave dict_distinct 2048                                                  1.00      3.5±0.01µs        ? ?/sec    1.00      3.5±0.02µs        ? ?/sec
interleave dict_shared_distinct_tail 2048                                      1.00      3.1±0.02µs        ? ?/sec    1.01      3.2±0.01µs        ? ?/sec
interleave dict_sparse(20, 0.0) 100 [0..100, 100..230, 450..1000]              3.84   1501.4±4.67ns        ? ?/sec    1.00    391.0±3.18ns        ? ?/sec
interleave dict_sparse(20, 0.0) 1024 [0..100, 100..230, 450..1000, 0..1000]    2.47      3.1±0.02µs        ? ?/sec    1.00   1233.8±2.02ns        ? ?/sec
interleave dict_sparse(20, 0.0) 1024 [0..100, 100..230, 450..1000]             2.30      2.7±0.01µs        ? ?/sec    1.00   1186.9±3.50ns        ? ?/sec
interleave dict_sparse(20, 0.0) 400 [0..100, 100..230, 450..1000]              2.92   1915.3±8.65ns        ? ?/sec    1.00    656.6±3.19ns        ? ?/sec

Per-runner information
interleave_kernels — shard 1/1

Node: gk3-benchmark-cluster-nap-145kr8p5-4d3e9c1b-p6ql

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

uname:

Linux bench-c7083025287-5619-hr9ft 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 interleave_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 115.0s
Peak memory 18.7 MiB
Avg memory 17.1 MiB
CPU user 110.8s
CPU sys 0.0s
Peak spill 0 B

branch

Metric Value
Wall time 120.0s
Peak memory 18.7 MiB
Avg memory 16.9 MiB
CPU user 115.1s
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 November 23, 2026 04:37
@Rich-T-kid
Rich-T-kid requested review from alamb and jayzhan211 and a balanced review from Copilot November 23, 2026 04:37

Copilot AI 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.

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.

@Rich-T-kid

Copy link
Copy Markdown
Contributor Author

thanks for the review @alamb & @jayzhan211, Ive addressed all your comments. as for downstream affects of this change, ill try to open a datafusion PR that exercises this code path and share any results I find.

Copilot AI 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.

🟡 Changes recommended

The implementation still checks all input dictionaries rather than only the referenced valid mappings, causing unrelated retained inputs to disable the intended shared-dictionary optimization.

1 open issue

Review effort: Lite

Comment thread arrow-select/src/interleave.rs Resolved

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

Thank you @Rich-T-kid -- this now looks good to me

Comment thread arrow-select/src/interleave.rs Resolved
Comment thread arrow-select/src/interleave.rs Resolved
@Rich-T-kid
Rich-T-kid enabled auto-merge November 23, 2026 21:23

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

@Rich-T-kid thanks for the update. One change before merge: the shared-values check only matches values in the same Arc, so dictionaries from arrow's own zip (and concat outputs) still get their values concatenated.

Optional: since the referenced-input scan was dropped, Part of #12056 instead of Closes #12056 would keep the issue's unreferenced and all-null input case tracked.

Comment thread arrow-select/src/interleave.rs Resolved
Comment thread arrow-select/src/interleave.rs Resolved
@Rich-T-kid

Copy link
Copy Markdown
Contributor Author

run benchmark interleave_kernels
env:
BENCH_FILTER: "interleave dict"
baseline:
ref: "4661ae77c184d470f5c6fe65ecf5a373f73f8c98"
changed:
ref: "37b9ed7207984c59284f80ce8e1bf404c5e51a0d"

@adriangbot

Copy link
Copy Markdown

🤖 Benchmark starting (GKE) | trigger

Target: interleave_kernels

Sharding factor: 1 (1 workers).

Comparing 37b9ed7 (37b9ed7) to 4661ae7 diff

Run configuration
run benchmark interleave_kernels
baseline:
  ref: 4661ae77c184d470f5c6fe65ecf5a373f73f8c98
changed:
  ref: 37b9ed7207984c59284f80ce8e1bf404c5e51a0d
env:
  BENCH_FILTER: interleave dict
shards: 1
Trigger comment
run benchmark interleave_kernels
env:
  BENCH_FILTER: "interleave dict"
baseline:
  ref: "4661ae77c184d470f5c6fe65ecf5a373f73f8c98"
changed:
  ref: "37b9ed7207984c59284f80ce8e1bf404c5e51a0d"

Results will be posted when all workers finish.


File an issue against this benchmark runner

@adriangbot

Copy link
Copy Markdown

🤖 Benchmark completed (GKE) | trigger

Target: interleave_kernels

Comparing 37b9ed7 (37b9ed7) to 4661ae7 diff

Run configuration
run benchmark interleave_kernels
baseline:
  ref: 4661ae77c184d470f5c6fe65ecf5a373f73f8c98
changed:
  ref: 37b9ed7207984c59284f80ce8e1bf404c5e51a0d
env:
  BENCH_FILTER: interleave dict
shards: 1
Trigger comment
run benchmark interleave_kernels
env:
  BENCH_FILTER: "interleave dict"
baseline:
  ref: "4661ae77c184d470f5c6fe65ecf5a373f73f8c98"
changed:
  ref: "37b9ed7207984c59284f80ce8e1bf404c5e51a0d"
Details
group                                                                          base                                   changed
-----                                                                          ----                                   -------
interleave dict(20, 0.0) 100 [0..100, 100..230, 450..1000]                     1.70    631.7±4.06ns        ? ?/sec    1.00    372.3±2.14ns        ? ?/sec
interleave dict(20, 0.0) 1024 [0..100, 100..230, 450..1000, 0..1000]           1.61   1863.8±9.28ns        ? ?/sec    1.00   1160.3±2.39ns        ? ?/sec
interleave dict(20, 0.0) 1024 [0..100, 100..230, 450..1000]                    1.56   1885.5±5.77ns        ? ?/sec    1.00   1208.5±3.88ns        ? ?/sec
interleave dict(20, 0.0) 400 [0..100, 100..230, 450..1000]                     1.59   1011.3±4.92ns        ? ?/sec    1.00    638.0±2.66ns        ? ?/sec
interleave dict_distinct 100                                                   1.01      2.2±0.00µs        ? ?/sec    1.00      2.2±0.01µs        ? ?/sec
interleave dict_distinct 1024                                                  1.05      7.0±0.01µs        ? ?/sec    1.00      6.7±0.01µs        ? ?/sec
interleave dict_distinct 2048                                                  1.00      3.4±0.02µs        ? ?/sec    1.01      3.5±0.02µs        ? ?/sec
interleave dict_shared_distinct_tail 2048                                      1.05      3.3±0.05µs        ? ?/sec    1.00      3.1±0.01µs        ? ?/sec
interleave dict_sparse(20, 0.0) 100 [0..100, 100..230, 450..1000]              4.08   1522.4±4.17ns        ? ?/sec    1.00    373.1±2.74ns        ? ?/sec
interleave dict_sparse(20, 0.0) 1024 [0..100, 100..230, 450..1000, 0..1000]    2.59      3.0±0.01µs        ? ?/sec    1.00   1168.7±1.89ns        ? ?/sec
interleave dict_sparse(20, 0.0) 1024 [0..100, 100..230, 450..1000]             2.36      2.7±0.01µs        ? ?/sec    1.00   1161.0±2.35ns        ? ?/sec
interleave dict_sparse(20, 0.0) 400 [0..100, 100..230, 450..1000]              3.08   1937.2±3.62ns        ? ?/sec    1.00    628.7±2.27ns        ? ?/sec

Per-runner information
interleave_kernels — shard 1/1

Node: gk3-benchmark-cluster-nap-10ma44s8-7e908d43-2czx

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

uname:

Linux bench-c7272925857-5921-phwmj 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 interleave_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 115.0s
Peak memory 18.6 MiB
Avg memory 17.0 MiB
CPU user 111.0s
CPU sys 0.0s
Peak spill 0 B

branch

Metric Value
Wall time 115.0s
Peak memory 18.3 MiB
Avg memory 17.3 MiB
CPU user 113.1s
CPU sys 0.0s
Peak spill 0 B

File an issue against this benchmark runner

@Rich-T-kid

Copy link
Copy Markdown
Contributor Author

@jayzhan211 PTAL 🙇

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

@Rich-T-kid thanks for the update. The buffer check works: zip of two dictionaries that share 10 string values now keeps 10 values instead of 20, and Miri passes on the dictionary interleave tests. One ask before merge: a test for values that share buffers but not nulls (inline on dictionary.rs).

Optional: the description still covers only the shared-Arc case. Could you update it to match the last commit?

  • Rationale, first sentence: "interleave currently concatenates dictionary values even when every input uses the same values: the same Arc, or the same buffers in different Arcs, as zip and ArrayData round trips produce."
  • What changes: "When every input's values array is the same Arc or, for byte and primitive values, has the same buffers and null buffer, interleave keeps the first input's values and interleaves the keys directly."
  • Tests: add the ArrayData round-trip (Utf8, Int64) and Utf8View reuse tests.
  • Benchmark row: the latest run shows shared mappings 1.6–4.1x faster and the distinct cases between 1% slower and 5% faster.

Comment thread arrow-select/src/dictionary.rs Resolved

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-core Core crates related to representing arrow data arrow-kernels Crates that transform arrow data (e.g. compute, cast) performance Speed or memory optimizations

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants