Skip to content

perf(coalesce): directly copy sparse UInt32 selections - #11174

Merged
alamb merged 9 commits into
apache:mainfrom
Rich-T-kid:rich-T-kid/coalescer-interleave
Nov 12, 2026
Merged

alamb merged 9 commits into
apache:mainfrom
Rich-T-kid:rich-T-kid/coalescer-interleave

Conversation

@Rich-T-kid

@Rich-T-kid Rich-T-kid commented Sep 22, 2026 •

Copy link
Copy Markdown
Contributor

Which issue does this PR close?

Closes #8957.

Rationale for this change

BatchCoalescer::push_batch_with_indices normally materializes a selected RecordBatch with take_record_batch before copying it into the coalescer. Sparse selections can copy supported columns directly and avoid that intermediate batch.

What changes are included in this PR?

Non-null UInt32 indices are validated once before any builder is mutated. Sparse selections then copy primitive and byte-view values directly; other columns use their existing per-column take path. Byte-view columns use a stricter density cutoff and reuse or compact source buffers as appropriate.

Dense selections, nullable indices, and other index types retain the materialized path. Direct copies still honor target batch boundaries and the configured large-batch bypass.

Are these changes tested?

The tests compare direct copies with take across primitive, byte-view, and mixed schemas. They cover nulls, reordered and repeated indices, buffer reuse and remapping, density cutoffs, batch splitting, empty selections, schema mismatches, large-batch bypass, and out-of-bounds rejection before partial mutation.

Hosted benchmark results show the sparse-selection gains. That run predates the final safety-contract cleanup, which has not been benchmarked separately.

Are there any significant user-facing changes?

No public API changes.

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

@Rich-T-kid Rich-T-kid left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

left a few thoughts

Comment thread arrow-select/src/coalesce.rs Resolved
Comment thread arrow-select/src/coalesce.rs Resolved
Comment thread arrow-select/src/coalesce.rs Resolved
Comment thread arrow/benches/coalesce_kernels.rs Resolved
@Rich-T-kid

Copy link
Copy Markdown
Contributor Author

at the risk of scope creep I think its worth introducing a couple things in this PR

  1. two new methods on the inprogressArrays trait that will make it easier to avoid copies with push_interleave()/push_take()
  2. 1 new method push_interleave() in batchCoalescer
  3. new benchmarks for this new method on batchCoalescer

follow up PR will implement

  1. optimized push_take for primitives
  2. optimized push_interleave for primitves
  3. optimized push_take for utf8View
  4. optimized push_interleave for utf8View
    ... fsb same idea

we will keep the default path for non-specialized arrays.

@Rich-T-kid

Copy link
Copy Markdown
Contributor Author

PR description and commits are cleaned up. ready for review 🚀

@Rich-T-kid Rich-T-kid changed the title feat(coalesce): add BatchCoalescer::push_batch_interleaved feat(coalesce): add BatchCoalescer::push_batch_interleaved + trait methods Sep 25, 2026
@Rich-T-kid

Copy link
Copy Markdown
Contributor Author

@alamb @Dandandan bumping this as its very related to apache/datafusion#7001 (comment)

@Rich-T-kid

Copy link
Copy Markdown
Contributor Author

I think im going to revamp this PR. I dont like the current API thats being used & I dont like the scope creep.

Ill explain more in the refrenced issue.

@Rich-T-kid
Rich-T-kid marked this pull request as draft October 4, 2026 19:14
@Rich-T-kid
Rich-T-kid force-pushed the rich-T-kid/coalescer-interleave branch 2 times, most recently from e497cc2 to 25a2c8e Compare October 7, 2026 03:06

@Rich-T-kid Rich-T-kid left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Should add benchmark + test for the new methods + trait

Comment thread arrow-select/src/coalesce.rs Resolved
Comment thread arrow-select/src/coalesce.rs Resolved
Comment thread arrow-select/src/coalesce.rs Resolved
Comment thread arrow-select/src/coalesce.rs Resolved
Comment thread arrow-select/src/coalesce/primitive.rs Resolved
@Rich-T-kid Rich-T-kid closed this Oct 12, 2026
@Rich-T-kid
Rich-T-kid deleted the rich-T-kid/coalescer-interleave branch October 12, 2026 04:25
@Rich-T-kid
Rich-T-kid restored the rich-T-kid/coalescer-interleave branch October 12, 2026 04:26
@Rich-T-kid Rich-T-kid reopened this Oct 12, 2026
@Rich-T-kid
Rich-T-kid force-pushed the rich-T-kid/coalescer-interleave branch from 25a2c8e to 03facf1 Compare October 12, 2026 04:30
@Rich-T-kid Rich-T-kid changed the title feat(coalesce): add BatchCoalescer::push_batch_interleaved + trait methods perf(coalesce): route push_batch_with_indices through zero-copy fast path Oct 12, 2026
@github-actions github-actions Bot added the arrow-kernels Crates that transform arrow data (e.g. compute, cast) label Oct 12, 2026
Comment thread arrow-select/src/coalesce.rs Resolved
@Rich-T-kid
Rich-T-kid force-pushed the rich-T-kid/coalescer-interleave branch from c57c595 to ab144b3 Compare October 14, 2026 15:27
@Rich-T-kid

Copy link
Copy Markdown
Contributor Author

run benchmark coalesce_kernels
env:
BENCH_FILTER: "take"

@adriangbot

Copy link
Copy Markdown

🤖 Benchmark starting (GKE) | trigger

Target: coalesce_kernels

Sharding factor: 1 (1 workers).

Comparing rich-T-kid/coalescer-interleave (ab144b3) to 0706d31 (merge-base) diff

Run configuration
run benchmark coalesce_kernels
env:
  BENCH_FILTER: take
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: coalesce_kernels

Comparing rich-T-kid/coalescer-interleave (ab144b3) to 0706d31 (merge-base) diff

Run configuration
run benchmark coalesce_kernels
env:
  BENCH_FILTER: take
shards: 1
Details
group                                                                                              base                                   changed
-----                                                                                              ----                                   -------
take: mixed_binaryview (max_string_len=128), 8192, nulls: 0, selectivity: 0.001                    3.86     13.6±0.15ms        ? ?/sec    1.00      3.5±0.01ms        ? ?/sec
take: mixed_binaryview (max_string_len=128), 8192, nulls: 0, selectivity: 0.01                     3.61      3.4±0.02ms        ? ?/sec    1.00    941.6±1.93µs        ? ?/sec
take: mixed_binaryview (max_string_len=128), 8192, nulls: 0, selectivity: 0.1                      4.12      3.2±0.12ms        ? ?/sec    1.00    775.4±1.18µs        ? ?/sec
take: mixed_binaryview (max_string_len=128), 8192, nulls: 0, selectivity: 0.8                      5.13      2.3±0.13ms        ? ?/sec    1.00    442.2±0.73µs        ? ?/sec
take: mixed_binaryview (max_string_len=128), 8192, nulls: 0.1, selectivity: 0.001                  4.70     20.6±0.09ms        ? ?/sec    1.00      4.4±0.00ms        ? ?/sec
take: mixed_binaryview (max_string_len=128), 8192, nulls: 0.1, selectivity: 0.01                   2.01      4.6±0.02ms        ? ?/sec    1.00      2.3±0.01ms        ? ?/sec
take: mixed_binaryview (max_string_len=128), 8192, nulls: 0.1, selectivity: 0.1                    1.61      3.4±0.17ms        ? ?/sec    1.00      2.1±0.00ms        ? ?/sec
take: mixed_binaryview (max_string_len=128), 8192, nulls: 0.1, selectivity: 0.8                    1.00    864.0±2.82µs        ? ?/sec    1.97   1702.9±5.49µs        ? ?/sec
take: mixed_binaryview (max_string_len=20), 8192, nulls: 0, selectivity: 0.001                     4.48     12.7±0.10ms        ? ?/sec    1.00      2.8±0.01ms        ? ?/sec
take: mixed_binaryview (max_string_len=20), 8192, nulls: 0, selectivity: 0.01                      2.70      2.3±0.02ms        ? ?/sec    1.00    857.9±4.06µs        ? ?/sec
take: mixed_binaryview (max_string_len=20), 8192, nulls: 0, selectivity: 0.1                       2.16   1637.8±5.23µs        ? ?/sec    1.00    758.4±0.73µs        ? ?/sec
take: mixed_binaryview (max_string_len=20), 8192, nulls: 0, selectivity: 0.8                       2.54   1111.2±4.78µs        ? ?/sec    1.00    437.5±1.17µs        ? ?/sec
take: mixed_binaryview (max_string_len=20), 8192, nulls: 0.1, selectivity: 0.001                   5.33     19.7±0.09ms        ? ?/sec    1.00      3.7±0.01ms        ? ?/sec
take: mixed_binaryview (max_string_len=20), 8192, nulls: 0.1, selectivity: 0.01                    1.59      3.6±0.02ms        ? ?/sec    1.00      2.3±0.01ms        ? ?/sec
take: mixed_binaryview (max_string_len=20), 8192, nulls: 0.1, selectivity: 0.1                     1.00   1989.5±6.53µs        ? ?/sec    1.06      2.1±0.00ms        ? ?/sec
take: mixed_binaryview (max_string_len=20), 8192, nulls: 0.1, selectivity: 0.8                     1.00    854.0±2.39µs        ? ?/sec    1.97   1685.9±6.10µs        ? ?/sec
take: mixed_dict, 8192, nulls: 0, selectivity: 0.001                                               1.00    114.7±5.30ms        ? ?/sec    1.03    118.4±1.69ms        ? ?/sec
take: mixed_dict, 8192, nulls: 0, selectivity: 0.01                                                1.00      5.4±0.05ms        ? ?/sec    1.00      5.4±0.03ms        ? ?/sec
take: mixed_dict, 8192, nulls: 0, selectivity: 0.1                                                 1.02      3.8±0.03ms        ? ?/sec    1.00      3.7±0.02ms        ? ?/sec
take: mixed_dict, 8192, nulls: 0, selectivity: 0.8                                                 1.01      2.0±0.02ms        ? ?/sec    1.00      2.0±0.01ms        ? ?/sec
take: mixed_dict, 8192, nulls: 0.1, selectivity: 0.001                                             1.00    111.1±7.09ms        ? ?/sec    1.03    114.2±3.78ms        ? ?/sec
take: mixed_dict, 8192, nulls: 0.1, selectivity: 0.01                                              1.00      5.9±0.04ms        ? ?/sec    1.01      5.9±0.05ms        ? ?/sec
take: mixed_dict, 8192, nulls: 0.1, selectivity: 0.1                                               1.00      3.7±0.03ms        ? ?/sec    1.00      3.7±0.03ms        ? ?/sec
take: mixed_dict, 8192, nulls: 0.1, selectivity: 0.8                                               1.02      2.1±0.03ms        ? ?/sec    1.00      2.0±0.01ms        ? ?/sec
take: mixed_utf8 extra_large_repeat, input: 8192, output: 131072, nulls: 0, biggest: Some(1024)    1.00    175.4±4.29ms        ? ?/sec    1.01    176.7±5.62ms        ? ?/sec
take: mixed_utf8, 8192, nulls: 0, selectivity: 0.001                                               1.01     23.0±0.15ms        ? ?/sec    1.00     22.8±0.08ms        ? ?/sec
take: mixed_utf8, 8192, nulls: 0, selectivity: 0.01                                                1.01      6.7±0.07ms        ? ?/sec    1.00      6.7±0.05ms        ? ?/sec
take: mixed_utf8, 8192, nulls: 0, selectivity: 0.1                                                 1.00      6.3±0.48ms        ? ?/sec    1.06      6.7±0.27ms        ? ?/sec
take: mixed_utf8, 8192, nulls: 0, selectivity: 0.8                                                 1.00      6.1±0.31ms        ? ?/sec    1.04      6.3±0.22ms        ? ?/sec
take: mixed_utf8, 8192, nulls: 0.1, selectivity: 0.001                                             1.01     33.4±0.24ms        ? ?/sec    1.00     33.0±0.25ms        ? ?/sec
take: mixed_utf8, 8192, nulls: 0.1, selectivity: 0.01                                              1.00      8.3±0.08ms        ? ?/sec    1.02      8.4±0.07ms        ? ?/sec
take: mixed_utf8, 8192, nulls: 0.1, selectivity: 0.1                                               1.00      6.4±0.24ms        ? ?/sec    1.01      6.5±0.33ms        ? ?/sec
take: mixed_utf8, 8192, nulls: 0.1, selectivity: 0.8                                               1.00      5.2±0.48ms        ? ?/sec    1.01      5.3±0.44ms        ? ?/sec
take: mixed_utf8view (max_string_len=128), 8192, nulls: 0, selectivity: 0.001                      3.91     13.6±0.07ms        ? ?/sec    1.00      3.5±0.01ms        ? ?/sec
take: mixed_utf8view (max_string_len=128), 8192, nulls: 0, selectivity: 0.01                       3.50      3.3±0.02ms        ? ?/sec    1.00    943.2±3.21µs        ? ?/sec
take: mixed_utf8view (max_string_len=128), 8192, nulls: 0, selectivity: 0.1                        3.80      2.9±0.16ms        ? ?/sec    1.00    765.4±0.89µs        ? ?/sec
take: mixed_utf8view (max_string_len=128), 8192, nulls: 0, selectivity: 0.8                        4.79      2.1±0.11ms        ? ?/sec    1.00    444.8±1.53µs        ? ?/sec
take: mixed_utf8view (max_string_len=128), 8192, nulls: 0.1, selectivity: 0.001                    4.75     20.6±0.08ms        ? ?/sec    1.00      4.3±0.01ms        ? ?/sec
take: mixed_utf8view (max_string_len=128), 8192, nulls: 0.1, selectivity: 0.01                     2.01      4.5±0.04ms        ? ?/sec    1.00      2.2±0.01ms        ? ?/sec
take: mixed_utf8view (max_string_len=128), 8192, nulls: 0.1, selectivity: 0.1                      1.58      3.3±0.13ms        ? ?/sec    1.00      2.1±0.00ms        ? ?/sec
take: mixed_utf8view (max_string_len=128), 8192, nulls: 0.1, selectivity: 0.8                      1.00    860.7±1.90µs        ? ?/sec    1.97   1695.5±6.02µs        ? ?/sec
take: mixed_utf8view (max_string_len=20), 8192, nulls: 0, selectivity: 0.001                       4.87     12.7±0.08ms        ? ?/sec    1.00      2.6±0.00ms        ? ?/sec
take: mixed_utf8view (max_string_len=20), 8192, nulls: 0, selectivity: 0.01                        2.73      2.3±0.02ms        ? ?/sec    1.00    835.1±3.48µs        ? ?/sec
take: mixed_utf8view (max_string_len=20), 8192, nulls: 0, selectivity: 0.1                         1.80   1350.5±4.45µs        ? ?/sec    1.00    752.1±1.00µs        ? ?/sec
take: mixed_utf8view (max_string_len=20), 8192, nulls: 0, selectivity: 0.8                         1.31    574.5±1.46µs        ? ?/sec    1.00    438.5±1.03µs        ? ?/sec
take: mixed_utf8view (max_string_len=20), 8192, nulls: 0.1, selectivity: 0.001                     5.41     19.7±0.09ms        ? ?/sec    1.00      3.6±0.02ms        ? ?/sec
take: mixed_utf8view (max_string_len=20), 8192, nulls: 0.1, selectivity: 0.01                      1.60      3.4±0.02ms        ? ?/sec    1.00      2.2±0.01ms        ? ?/sec
take: mixed_utf8view (max_string_len=20), 8192, nulls: 0.1, selectivity: 0.1                       1.00   1732.5±4.46µs        ? ?/sec    1.19      2.1±0.01ms        ? ?/sec
take: mixed_utf8view (max_string_len=20), 8192, nulls: 0.1, selectivity: 0.8                       1.00    859.4±2.15µs        ? ?/sec    1.96   1685.4±5.23µs        ? ?/sec
take: primitive extra_large_repeat, input: 8192, output: 131072, nulls: 0, biggest: Some(1024)     14.84    12.3±0.47ms        ? ?/sec    1.00    828.9±5.38µs        ? ?/sec
take: primitive, 8192, nulls: 0, selectivity: 0.001                                                6.43     30.4±0.32ms        ? ?/sec    1.00      4.7±0.04ms        ? ?/sec
take: primitive, 8192, nulls: 0, selectivity: 0.01                                                 3.10      4.7±0.03ms        ? ?/sec    1.00  1523.2±10.43µs        ? ?/sec
take: primitive, 8192, nulls: 0, selectivity: 0.1                                                  1.52   1737.2±3.98µs        ? ?/sec    1.00   1144.6±1.42µs        ? ?/sec
take: primitive, 8192, nulls: 0, selectivity: 0.8                                                  1.15    844.0±0.92µs        ? ?/sec    1.00    737.1±0.97µs        ? ?/sec
take: primitive, 8192, nulls: 0.1, selectivity: 0.001                                              6.33     47.3±0.27ms        ? ?/sec    1.00      7.5±0.04ms        ? ?/sec
take: primitive, 8192, nulls: 0.1, selectivity: 0.01                                               1.28      7.0±0.04ms        ? ?/sec    1.00      5.4±0.04ms        ? ?/sec
take: primitive, 8192, nulls: 0.1, selectivity: 0.1                                                1.00      2.7±0.01ms        ? ?/sec    1.64      4.4±0.01ms        ? ?/sec
take: primitive, 8192, nulls: 0.1, selectivity: 0.8                                                1.00   1524.5±2.73µs        ? ?/sec    2.48      3.8±0.02ms        ? ?/sec
take: single_binary, 8192, nulls: 0, selectivity: 0.001                                            1.00     23.6±0.15ms        ? ?/sec    1.02     24.0±0.05ms        ? ?/sec
take: single_binary, 8192, nulls: 0, selectivity: 0.01                                             1.00      5.2±0.01ms        ? ?/sec    1.03      5.3±0.03ms        ? ?/sec
take: single_binary, 8192, nulls: 0, selectivity: 0.1                                              1.00      2.9±0.00ms        ? ?/sec    1.01      2.9±0.00ms        ? ?/sec
take: single_binary, 8192, nulls: 0, selectivity: 0.8                                              1.01      2.1±0.00ms        ? ?/sec    1.00      2.0±0.00ms        ? ?/sec
take: single_binary, 8192, nulls: 0.1, selectivity: 0.001                                          1.00     32.9±0.15ms        ? ?/sec    1.01     33.1±0.08ms        ? ?/sec
take: single_binary, 8192, nulls: 0.1, selectivity: 0.01                                           1.00      6.3±0.05ms        ? ?/sec    1.09      6.9±0.04ms        ? ?/sec
take: single_binary, 8192, nulls: 0.1, selectivity: 0.1                                            1.00      3.0±0.02ms        ? ?/sec    1.04      3.1±0.02ms        ? ?/sec
take: single_binary, 8192, nulls: 0.1, selectivity: 0.8                                            1.00      2.2±0.02ms        ? ?/sec    1.00      2.2±0.02ms        ? ?/sec
take: single_binaryview, 8192, nulls: 0, selectivity: 0.001                                        2.65     13.4±0.18ms        ? ?/sec    1.00      5.1±0.05ms        ? ?/sec
take: single_binaryview, 8192, nulls: 0, selectivity: 0.01                                         2.87      3.0±0.03ms        ? ?/sec    1.00   1054.1±4.26µs        ? ?/sec
take: single_binaryview, 8192, nulls: 0, selectivity: 0.1                                          3.48      3.2±0.01ms        ? ?/sec    1.00    917.4±1.32µs        ? ?/sec
take: single_binaryview, 8192, nulls: 0, selectivity: 0.8                                          1.31    828.6±1.00µs        ? ?/sec    1.00    633.2±0.56µs        ? ?/sec
take: single_binaryview, 8192, nulls: 0.1, selectivity: 0.001                                      3.46     20.2±0.08ms        ? ?/sec    1.00      5.8±0.01ms        ? ?/sec
take: single_binaryview, 8192, nulls: 0.1, selectivity: 0.01                                       2.04      4.2±0.02ms        ? ?/sec    1.00      2.0±0.01ms        ? ?/sec
take: single_binaryview, 8192, nulls: 0.1, selectivity: 0.1                                        1.75      3.5±0.01ms        ? ?/sec    1.00   1990.8±4.25µs        ? ?/sec
take: single_binaryview, 8192, nulls: 0.1, selectivity: 0.8                                        1.00   1066.5±1.66µs        ? ?/sec    1.60   1705.4±4.31µs        ? ?/sec
take: single_boolean, 8192, nulls: 0, selectivity: 0.001                                           1.00     13.6±0.07ms        ? ?/sec    1.02     13.8±0.05ms        ? ?/sec
take: single_boolean, 8192, nulls: 0, selectivity: 0.01                                            1.00   1552.4±9.08µs        ? ?/sec    1.01   1572.3±5.25µs        ? ?/sec
take: single_boolean, 8192, nulls: 0, selectivity: 0.1                                             1.00    360.5±0.75µs        ? ?/sec    1.01    363.9±0.47µs        ? ?/sec
take: single_boolean, 8192, nulls: 0, selectivity: 0.8                                             1.00    240.9±0.26µs        ? ?/sec    1.01    243.0±0.33µs        ? ?/sec
take: single_boolean, 8192, nulls: 0.1, selectivity: 0.001                                         1.00     20.3±0.16ms        ? ?/sec    1.00     20.2±0.05ms        ? ?/sec
take: single_boolean, 8192, nulls: 0.1, selectivity: 0.01                                          1.00      2.5±0.02ms        ? ?/sec    1.00      2.5±0.00ms        ? ?/sec
take: single_boolean, 8192, nulls: 0.1, selectivity: 0.1                                           1.00    616.5±2.07µs        ? ?/sec    1.00    619.3±0.75µs        ? ?/sec
take: single_boolean, 8192, nulls: 0.1, selectivity: 0.8                                           1.00    431.6±0.52µs        ? ?/sec    1.00    431.8±0.44µs        ? ?/sec
take: single_fsb16, 8192, nulls: 0, selectivity: 0.001                                             1.00     12.5±0.12ms        ? ?/sec    1.02     12.7±0.06ms        ? ?/sec
take: single_fsb16, 8192, nulls: 0, selectivity: 0.01                                              1.02  1735.1±12.42µs        ? ?/sec    1.00  1700.2±11.20µs        ? ?/sec
take: single_fsb16, 8192, nulls: 0, selectivity: 0.1                                               1.05    751.1±1.48µs        ? ?/sec    1.00    717.6±1.45µs        ? ?/sec
take: single_fsb16, 8192, nulls: 0, selectivity: 0.8                                               1.03    471.0±1.13µs        ? ?/sec    1.00    456.9±0.64µs        ? ?/sec
take: single_fsb16, 8192, nulls: 0.1, selectivity: 0.001                                           1.01     19.6±0.26ms        ? ?/sec    1.00     19.4±0.13ms        ? ?/sec
take: single_fsb16, 8192, nulls: 0.1, selectivity: 0.01                                            1.00      3.1±0.02ms        ? ?/sec    1.02      3.1±0.01ms        ? ?/sec
take: single_fsb16, 8192, nulls: 0.1, selectivity: 0.1                                             1.00   1073.8±3.26µs        ? ?/sec    1.02   1090.1±2.71µs        ? ?/sec
take: single_fsb16, 8192, nulls: 0.1, selectivity: 0.8                                             1.00    701.1±1.79µs        ? ?/sec    1.01    709.3±0.99µs        ? ?/sec
take: single_fsb32, 8192, nulls: 0, selectivity: 0.001                                             1.00     13.2±0.16ms        ? ?/sec    1.00     13.3±0.03ms        ? ?/sec
take: single_fsb32, 8192, nulls: 0, selectivity: 0.01                                              1.00      2.4±0.02ms        ? ?/sec    1.05      2.5±0.02ms        ? ?/sec
take: single_fsb32, 8192, nulls: 0, selectivity: 0.1                                               1.00      2.0±0.01ms        ? ?/sec    1.01      2.1±0.01ms        ? ?/sec
take: single_fsb32, 8192, nulls: 0, selectivity: 0.8                                               1.00   1509.7±4.10µs        ? ?/sec    1.01   1525.1±5.73µs        ? ?/sec
take: single_fsb32, 8192, nulls: 0.1, selectivity: 0.001                                           1.01     21.0±0.19ms        ? ?/sec    1.00     20.7±0.08ms        ? ?/sec
take: single_fsb32, 8192, nulls: 0.1, selectivity: 0.01                                            1.00      3.7±0.02ms        ? ?/sec    1.01      3.8±0.02ms        ? ?/sec
take: single_fsb32, 8192, nulls: 0.1, selectivity: 0.1                                             1.00      2.4±0.01ms        ? ?/sec    1.05      2.5±0.01ms        ? ?/sec
take: single_fsb32, 8192, nulls: 0.1, selectivity: 0.8                                             1.00   1742.8±5.65µs        ? ?/sec    1.04   1805.1±6.03µs        ? ?/sec
take: single_fsl4, 8192, nulls: 0, selectivity: 0.001                                              1.00     34.8±0.31ms        ? ?/sec    1.01     35.2±0.32ms        ? ?/sec
take: single_fsl4, 8192, nulls: 0, selectivity: 0.01                                               1.00      5.1±0.03ms        ? ?/sec    1.01      5.1±0.03ms        ? ?/sec
take: single_fsl4, 8192, nulls: 0, selectivity: 0.1                                                1.03   1996.3±3.55µs        ? ?/sec    1.00   1935.9±5.88µs        ? ?/sec
take: single_fsl4, 8192, nulls: 0, selectivity: 0.8                                                1.01   1219.8±2.14µs        ? ?/sec    1.00   1202.4±2.58µs        ? ?/sec
take: single_fsl4, 8192, nulls: 0.1, selectivity: 0.001                                            1.00     58.2±0.21ms        ? ?/sec    1.03     59.9±0.29ms        ? ?/sec
take: single_fsl4, 8192, nulls: 0.1, selectivity: 0.01                                             1.00     10.9±0.03ms        ? ?/sec    1.01     11.0±0.03ms        ? ?/sec
take: single_fsl4, 8192, nulls: 0.1, selectivity: 0.1                                              1.00      5.3±0.01ms        ? ?/sec    1.01      5.3±0.01ms        ? ?/sec
take: single_fsl4, 8192, nulls: 0.1, selectivity: 0.8                                              1.00      4.6±0.01ms        ? ?/sec    1.00      4.6±0.01ms        ? ?/sec
take: single_list, 8192, nulls: 0, selectivity: 0.001                                              1.00     44.0±0.30ms        ? ?/sec    1.02     45.0±0.11ms        ? ?/sec
take: single_list, 8192, nulls: 0, selectivity: 0.01                                               1.00      9.3±0.21ms        ? ?/sec    1.07      9.9±0.04ms        ? ?/sec
take: single_list, 8192, nulls: 0, selectivity: 0.1                                                1.00      5.2±0.02ms        ? ?/sec    1.03      5.3±0.02ms        ? ?/sec
take: single_list, 8192, nulls: 0, selectivity: 0.8                                                1.00      3.7±0.02ms        ? ?/sec    1.01      3.8±0.02ms        ? ?/sec
take: single_list, 8192, nulls: 0.1, selectivity: 0.001                                            1.00     51.8±0.25ms        ? ?/sec    1.01     52.4±0.14ms        ? ?/sec
take: single_list, 8192, nulls: 0.1, selectivity: 0.01                                             1.00     10.7±0.11ms        ? ?/sec    1.05     11.2±0.31ms        ? ?/sec
take: single_list, 8192, nulls: 0.1, selectivity: 0.1                                              1.00      6.1±0.02ms        ? ?/sec    1.04      6.3±0.03ms        ? ?/sec
take: single_list, 8192, nulls: 0.1, selectivity: 0.8                                              1.00      4.5±0.04ms        ? ?/sec    1.00      4.5±0.03ms        ? ?/sec
take: single_utf8, 8192, nulls: 0, selectivity: 0.001                                              1.00     36.1±0.17ms        ? ?/sec    1.01     36.4±0.22ms        ? ?/sec
take: single_utf8, 8192, nulls: 0, selectivity: 0.01                                               1.00     12.8±0.09ms        ? ?/sec    1.00     12.7±0.08ms        ? ?/sec
take: single_utf8, 8192, nulls: 0, selectivity: 0.1                                                1.00     14.3±0.73ms        ? ?/sec    1.01     14.4±0.87ms        ? ?/sec
take: single_utf8, 8192, nulls: 0, selectivity: 0.8                                                1.21     14.0±1.46ms        ? ?/sec    1.00     11.6±1.72ms        ? ?/sec
take: single_utf8, 8192, nulls: 0.1, selectivity: 0.001                                            1.00     46.9±0.35ms        ? ?/sec    1.02     47.6±0.29ms        ? ?/sec
take: single_utf8, 8192, nulls: 0.1, selectivity: 0.01                                             1.00     14.1±0.06ms        ? ?/sec    1.05     14.8±0.09ms        ? ?/sec
take: single_utf8, 8192, nulls: 0.1, selectivity: 0.1                                              1.10     14.0±0.51ms        ? ?/sec    1.00     12.8±0.68ms        ? ?/sec
take: single_utf8, 8192, nulls: 0.1, selectivity: 0.8                                              1.02     12.5±0.82ms        ? ?/sec    1.00     12.2±0.71ms        ? ?/sec
take: single_utf8view, 8192, nulls: 0, selectivity: 0.001                                          2.76     13.4±0.19ms        ? ?/sec    1.00      4.9±0.01ms        ? ?/sec
take: single_utf8view, 8192, nulls: 0, selectivity: 0.01                                           2.76      3.0±0.02ms        ? ?/sec    1.00  1077.1±26.57µs        ? ?/sec
take: single_utf8view, 8192, nulls: 0, selectivity: 0.1                                            3.04      2.7±0.01ms        ? ?/sec    1.00    885.5±3.22µs        ? ?/sec
take: single_utf8view, 8192, nulls: 0, selectivity: 0.8                                            1.31    829.0±1.31µs        ? ?/sec    1.00    633.9±0.92µs        ? ?/sec
take: single_utf8view, 8192, nulls: 0.1, selectivity: 0.001                                        3.47     20.1±0.09ms        ? ?/sec    1.00      5.8±0.03ms        ? ?/sec
take: single_utf8view, 8192, nulls: 0.1, selectivity: 0.01                                         2.04      4.1±0.02ms        ? ?/sec    1.00      2.0±0.03ms        ? ?/sec
take: single_utf8view, 8192, nulls: 0.1, selectivity: 0.1                                          1.48      2.8±0.01ms        ? ?/sec    1.00  1924.8±14.60µs        ? ?/sec
take: single_utf8view, 8192, nulls: 0.1, selectivity: 0.8                                          1.00   1059.3±1.75µs        ? ?/sec    1.60  1691.1±13.50µs        ? ?/sec

Per-runner information
coalesce_kernels — shard 1/1

Node: gk3-benchmark-cluster-nap-1wzwczws-b8f8a7e3-njkg

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

uname:

Linux bench-c6171978547-3389-qq866 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 coalesce_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 1380.3s
Peak memory 59.9 MiB
Avg memory 20.4 MiB
CPU user 1352.3s
CPU sys 23.1s
Peak spill 0 B

branch

Metric Value
Wall time 1415.3s
Peak memory 59.9 MiB
Avg memory 20.4 MiB
CPU user 1386.1s
CPU sys 23.6s
Peak spill 0 B

File an issue against this benchmark runner

@Rich-T-kid
Rich-T-kid force-pushed the rich-T-kid/coalescer-interleave branch from ab144b3 to a766c82 Compare October 14, 2026 17:41
Scatter sparse non-null UInt32 selections directly into specialized primitive and byte-view builders, avoiding the intermediate taken RecordBatch. Validate indices before builder mutation and keep dense selections on the existing take path.

Compact sparse ByteView selections into bounded data blocks, while reusing source buffers for dense selections and repeated chunks. This keeps offsets valid when selected non-inline data exceeds a single Arrow buffer.

Closes apache#8957
Keep the existing primitive cutoff, but use the materialized take path above 1/16 selectivity when a batch contains Utf8View or BinaryView columns.
Hoist UInt32 OOB validation to the public entry so the error is
uniform across copy paths, drop the double validation, and keep the
InProgressArray trait on UInt32Array with the per-chunk alloc removed.
@Rich-T-kid

Copy link
Copy Markdown
Contributor Author

run benchmark coalesce_kernels

env:
BENCH_FILTER: "^take:"

@adriangbot

Copy link
Copy Markdown

🤖 Benchmark starting (GKE) | trigger

Target: coalesce_kernels

Sharding factor: 1 (1 workers).

Comparing rich-T-kid/coalescer-interleave (a8a97b1) to b65bab9 (merge-base) diff

Run configuration
run benchmark coalesce_kernels
env:
  BENCH_FILTER: '^take:'
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: coalesce_kernels

Comparing rich-T-kid/coalescer-interleave (a8a97b1) to b65bab9 (merge-base) diff

Run configuration
run benchmark coalesce_kernels
env:
  BENCH_FILTER: '^take:'
shards: 1
Details
group                                                                                              base                                   changed
-----                                                                                              ----                                   -------
take: mixed_binaryview (max_string_len=128), 8192, nulls: 0, selectivity: 0.001                    4.61     15.0±0.07ms        ? ?/sec    1.00      3.2±0.01ms        ? ?/sec
take: mixed_binaryview (max_string_len=128), 8192, nulls: 0, selectivity: 0.01                     1.45      3.4±0.01ms        ? ?/sec    1.00      2.4±0.03ms        ? ?/sec
take: mixed_binaryview (max_string_len=128), 8192, nulls: 0, selectivity: 0.1                      1.00      3.1±0.03ms        ? ?/sec    1.00      3.1±0.03ms        ? ?/sec
take: mixed_binaryview (max_string_len=128), 8192, nulls: 0, selectivity: 0.8                      1.00      2.2±0.03ms        ? ?/sec    1.00      2.2±0.02ms        ? ?/sec
take: mixed_binaryview (max_string_len=128), 8192, nulls: 0.1, selectivity: 0.001                  2.45     21.3±0.06ms        ? ?/sec    1.00      8.7±0.04ms        ? ?/sec
take: mixed_binaryview (max_string_len=128), 8192, nulls: 0.1, selectivity: 0.01                   1.43      4.5±0.02ms        ? ?/sec    1.00      3.1±0.01ms        ? ?/sec
take: mixed_binaryview (max_string_len=128), 8192, nulls: 0.1, selectivity: 0.1                    1.00      3.3±0.03ms        ? ?/sec    1.03      3.3±0.03ms        ? ?/sec
take: mixed_binaryview (max_string_len=128), 8192, nulls: 0.1, selectivity: 0.8                    1.00    831.2±1.16µs        ? ?/sec    1.02    846.9±3.04µs        ? ?/sec
take: mixed_binaryview (max_string_len=20), 8192, nulls: 0, selectivity: 0.001                     5.47     14.3±0.09ms        ? ?/sec    1.00      2.6±0.01ms        ? ?/sec
take: mixed_binaryview (max_string_len=20), 8192, nulls: 0, selectivity: 0.01                      2.07      2.4±0.02ms        ? ?/sec    1.00   1145.5±4.22µs        ? ?/sec
take: mixed_binaryview (max_string_len=20), 8192, nulls: 0, selectivity: 0.1                       1.00   1729.1±2.88µs        ? ?/sec    1.00   1731.3±5.25µs        ? ?/sec
take: mixed_binaryview (max_string_len=20), 8192, nulls: 0, selectivity: 0.8                       1.00   1128.7±3.87µs        ? ?/sec    1.02   1148.3±5.03µs        ? ?/sec
take: mixed_binaryview (max_string_len=20), 8192, nulls: 0.1, selectivity: 0.001                   2.56     20.6±0.05ms        ? ?/sec    1.00      8.1±0.04ms        ? ?/sec
take: mixed_binaryview (max_string_len=20), 8192, nulls: 0.1, selectivity: 0.01                    1.78      3.5±0.01ms        ? ?/sec    1.00   1967.7±4.84µs        ? ?/sec
take: mixed_binaryview (max_string_len=20), 8192, nulls: 0.1, selectivity: 0.1                     1.00   1982.1±5.91µs        ? ?/sec    1.02      2.0±0.01ms        ? ?/sec
take: mixed_binaryview (max_string_len=20), 8192, nulls: 0.1, selectivity: 0.8                     1.00    824.9±0.89µs        ? ?/sec    1.02    838.5±1.61µs        ? ?/sec
take: mixed_dict, 8192, nulls: 0, selectivity: 0.001                                               1.03    111.2±0.87ms        ? ?/sec    1.00    107.8±1.33ms        ? ?/sec
take: mixed_dict, 8192, nulls: 0, selectivity: 0.01                                                1.06      6.9±0.02ms        ? ?/sec    1.00      6.5±0.02ms        ? ?/sec
take: mixed_dict, 8192, nulls: 0, selectivity: 0.1                                                 1.02      3.6±0.01ms        ? ?/sec    1.00      3.6±0.02ms        ? ?/sec
take: mixed_dict, 8192, nulls: 0, selectivity: 0.8                                                 1.00   1972.5±8.65µs        ? ?/sec    1.02      2.0±0.01ms        ? ?/sec
take: mixed_dict, 8192, nulls: 0.1, selectivity: 0.001                                             1.03    108.2±0.72ms        ? ?/sec    1.00    105.3±1.14ms        ? ?/sec
take: mixed_dict, 8192, nulls: 0.1, selectivity: 0.01                                              1.04      6.9±0.02ms        ? ?/sec    1.00      6.6±0.02ms        ? ?/sec
take: mixed_dict, 8192, nulls: 0.1, selectivity: 0.1                                               1.01      3.5±0.01ms        ? ?/sec    1.00      3.5±0.01ms        ? ?/sec
take: mixed_dict, 8192, nulls: 0.1, selectivity: 0.8                                               1.00   1989.8±9.21µs        ? ?/sec    1.01      2.0±0.01ms        ? ?/sec
take: mixed_utf8 extra_large_repeat, input: 8192, output: 131072, nulls: 0, biggest: Some(1024)    1.00    163.9±1.20ms        ? ?/sec    1.02    166.6±0.85ms        ? ?/sec
take: mixed_utf8, 8192, nulls: 0, selectivity: 0.001                                               1.78     20.2±0.07ms        ? ?/sec    1.00     11.4±0.04ms        ? ?/sec
take: mixed_utf8, 8192, nulls: 0, selectivity: 0.01                                                1.20      6.9±0.03ms        ? ?/sec    1.00      5.8±0.02ms        ? ?/sec
take: mixed_utf8, 8192, nulls: 0, selectivity: 0.1                                                 1.00      6.3±0.09ms        ? ?/sec    1.14      7.1±0.08ms        ? ?/sec
take: mixed_utf8, 8192, nulls: 0, selectivity: 0.8                                                 1.00      5.8±0.07ms        ? ?/sec    1.00      5.8±0.10ms        ? ?/sec
take: mixed_utf8, 8192, nulls: 0.1, selectivity: 0.001                                             1.40     28.6±0.13ms        ? ?/sec    1.00     20.5±0.08ms        ? ?/sec
take: mixed_utf8, 8192, nulls: 0.1, selectivity: 0.01                                              1.07      7.3±0.04ms        ? ?/sec    1.00      6.8±0.02ms        ? ?/sec
take: mixed_utf8, 8192, nulls: 0.1, selectivity: 0.1                                               1.00      5.8±0.12ms        ? ?/sec    1.10      6.5±0.07ms        ? ?/sec
take: mixed_utf8, 8192, nulls: 0.1, selectivity: 0.8                                               1.02      5.3±0.08ms        ? ?/sec    1.00      5.2±0.08ms        ? ?/sec
take: mixed_utf8view (max_string_len=128), 8192, nulls: 0, selectivity: 0.001                      4.61     14.9±0.05ms        ? ?/sec    1.00      3.2±0.02ms        ? ?/sec
take: mixed_utf8view (max_string_len=128), 8192, nulls: 0, selectivity: 0.01                       1.48      3.4±0.01ms        ? ?/sec    1.00      2.3±0.01ms        ? ?/sec
take: mixed_utf8view (max_string_len=128), 8192, nulls: 0, selectivity: 0.1                        1.01      3.1±0.03ms        ? ?/sec    1.00      3.1±0.03ms        ? ?/sec
take: mixed_utf8view (max_string_len=128), 8192, nulls: 0, selectivity: 0.8                        1.00      2.1±0.02ms        ? ?/sec    1.02      2.2±0.05ms        ? ?/sec
take: mixed_utf8view (max_string_len=128), 8192, nulls: 0.1, selectivity: 0.001                    2.47     21.3±0.12ms        ? ?/sec    1.00      8.6±0.02ms        ? ?/sec
take: mixed_utf8view (max_string_len=128), 8192, nulls: 0.1, selectivity: 0.01                     1.44      4.4±0.01ms        ? ?/sec    1.00      3.1±0.01ms        ? ?/sec
take: mixed_utf8view (max_string_len=128), 8192, nulls: 0.1, selectivity: 0.1                      1.00      3.2±0.03ms        ? ?/sec    1.02      3.3±0.03ms        ? ?/sec
take: mixed_utf8view (max_string_len=128), 8192, nulls: 0.1, selectivity: 0.8                      1.00    831.5±1.25µs        ? ?/sec    1.01    840.3±1.00µs        ? ?/sec
take: mixed_utf8view (max_string_len=20), 8192, nulls: 0, selectivity: 0.001                       5.51     14.2±0.06ms        ? ?/sec    1.00      2.6±0.01ms        ? ?/sec
take: mixed_utf8view (max_string_len=20), 8192, nulls: 0, selectivity: 0.01                        2.04      2.4±0.02ms        ? ?/sec    1.00   1176.5±5.14µs        ? ?/sec
take: mixed_utf8view (max_string_len=20), 8192, nulls: 0, selectivity: 0.1                         1.00   1640.7±3.81µs        ? ?/sec    1.00   1647.4±4.16µs        ? ?/sec
take: mixed_utf8view (max_string_len=20), 8192, nulls: 0, selectivity: 0.8                         1.00    562.4±0.72µs        ? ?/sec    1.01    565.4±0.76µs        ? ?/sec
take: mixed_utf8view (max_string_len=20), 8192, nulls: 0.1, selectivity: 0.001                     2.57     20.5±0.07ms        ? ?/sec    1.00      8.0±0.03ms        ? ?/sec
take: mixed_utf8view (max_string_len=20), 8192, nulls: 0.1, selectivity: 0.01                      1.75      3.5±0.01ms        ? ?/sec    1.00   1989.2±8.05µs        ? ?/sec
take: mixed_utf8view (max_string_len=20), 8192, nulls: 0.1, selectivity: 0.1                       1.00   1938.9±5.45µs        ? ?/sec    1.01   1966.2±4.98µs        ? ?/sec
take: mixed_utf8view (max_string_len=20), 8192, nulls: 0.1, selectivity: 0.8                       1.00    827.9±1.16µs        ? ?/sec    1.02    841.0±1.03µs        ? ?/sec
take: primitive extra_large_repeat, input: 8192, output: 131072, nulls: 0, biggest: Some(1024)     1.04     11.9±0.06ms        ? ?/sec    1.00     11.5±0.09ms        ? ?/sec
take: primitive, 8192, nulls: 0, selectivity: 0.001                                                6.73     33.5±0.27ms        ? ?/sec    1.00      5.0±0.05ms        ? ?/sec
take: primitive, 8192, nulls: 0, selectivity: 0.01                                                 2.63      4.7±0.20ms        ? ?/sec    1.00  1792.7±71.37µs        ? ?/sec
take: primitive, 8192, nulls: 0, selectivity: 0.1                                                  1.34   1797.6±3.56µs        ? ?/sec    1.00   1338.5±2.34µs        ? ?/sec
take: primitive, 8192, nulls: 0, selectivity: 0.8                                                  1.00    883.1±1.48µs        ? ?/sec    1.00    882.6±1.79µs        ? ?/sec
take: primitive, 8192, nulls: 0.1, selectivity: 0.001                                              2.75     49.3±0.29ms        ? ?/sec    1.00     18.0±0.08ms        ? ?/sec
take: primitive, 8192, nulls: 0.1, selectivity: 0.01                                               1.78      6.8±0.04ms        ? ?/sec    1.00      3.8±0.14ms        ? ?/sec
take: primitive, 8192, nulls: 0.1, selectivity: 0.1                                                1.24      2.6±0.01ms        ? ?/sec    1.00      2.1±0.00ms        ? ?/sec
take: primitive, 8192, nulls: 0.1, selectivity: 0.8                                                1.00   1558.3±1.84µs        ? ?/sec    1.00   1564.3±2.83µs        ? ?/sec
take: single_binary, 8192, nulls: 0, selectivity: 0.001                                            1.28     20.5±0.12ms        ? ?/sec    1.00     16.0±0.04ms        ? ?/sec
take: single_binary, 8192, nulls: 0, selectivity: 0.01                                             1.09      4.9±0.02ms        ? ?/sec    1.00      4.5±0.01ms        ? ?/sec
take: single_binary, 8192, nulls: 0, selectivity: 0.1                                              1.00      3.0±0.00ms        ? ?/sec    1.07      3.2±0.00ms        ? ?/sec
take: single_binary, 8192, nulls: 0, selectivity: 0.8                                              1.00      2.1±0.00ms        ? ?/sec    1.01      2.2±0.00ms        ? ?/sec
take: single_binary, 8192, nulls: 0.1, selectivity: 0.001                                          1.18     28.1±0.16ms        ? ?/sec    1.00     23.8±0.09ms        ? ?/sec
take: single_binary, 8192, nulls: 0.1, selectivity: 0.01                                           1.03      5.8±0.16ms        ? ?/sec    1.00      5.6±0.13ms        ? ?/sec
take: single_binary, 8192, nulls: 0.1, selectivity: 0.1                                            1.00      3.1±0.03ms        ? ?/sec    1.07      3.3±0.02ms        ? ?/sec
take: single_binary, 8192, nulls: 0.1, selectivity: 0.8                                            1.00      2.3±0.03ms        ? ?/sec    1.02      2.3±0.03ms        ? ?/sec
take: single_binaryview, 8192, nulls: 0, selectivity: 0.001                                        3.68     16.2±0.12ms        ? ?/sec    1.00      4.4±0.04ms        ? ?/sec
take: single_binaryview, 8192, nulls: 0, selectivity: 0.01                                         1.57      3.2±0.01ms        ? ?/sec    1.00      2.0±0.01ms        ? ?/sec
take: single_binaryview, 8192, nulls: 0, selectivity: 0.1                                          1.00      3.5±0.01ms        ? ?/sec    1.00      3.5±0.01ms        ? ?/sec
take: single_binaryview, 8192, nulls: 0, selectivity: 0.8                                          1.00    815.1±1.26µs        ? ?/sec    1.04    849.4±1.08µs        ? ?/sec
take: single_binaryview, 8192, nulls: 0.1, selectivity: 0.001                                      2.42     21.5±0.13ms        ? ?/sec    1.00      8.9±0.08ms        ? ?/sec
take: single_binaryview, 8192, nulls: 0.1, selectivity: 0.01                                       1.58      4.2±0.01ms        ? ?/sec    1.00      2.7±0.01ms        ? ?/sec
take: single_binaryview, 8192, nulls: 0.1, selectivity: 0.1                                        1.00      3.6±0.01ms        ? ?/sec    1.05      3.8±0.01ms        ? ?/sec
take: single_binaryview, 8192, nulls: 0.1, selectivity: 0.8                                        1.00   1016.6±2.80µs        ? ?/sec    1.05   1071.4±2.97µs        ? ?/sec
take: single_boolean, 8192, nulls: 0, selectivity: 0.001                                           1.31     12.5±0.33ms        ? ?/sec    1.00      9.5±0.02ms        ? ?/sec
take: single_boolean, 8192, nulls: 0, selectivity: 0.01                                            1.20  1467.5±29.32µs        ? ?/sec    1.00   1218.9±4.17µs        ? ?/sec
take: single_boolean, 8192, nulls: 0, selectivity: 0.1                                             1.00    359.0±4.47µs        ? ?/sec    1.05    375.3±0.46µs        ? ?/sec
take: single_boolean, 8192, nulls: 0, selectivity: 0.8                                             1.00    249.8±0.54µs        ? ?/sec    1.04    260.6±0.32µs        ? ?/sec
take: single_boolean, 8192, nulls: 0.1, selectivity: 0.001                                         1.22     18.3±0.31ms        ? ?/sec    1.00     15.0±0.12ms        ? ?/sec
take: single_boolean, 8192, nulls: 0.1, selectivity: 0.01                                          1.14      2.3±0.04ms        ? ?/sec    1.00      2.0±0.02ms        ? ?/sec
take: single_boolean, 8192, nulls: 0.1, selectivity: 0.1                                           1.00    620.7±5.32µs        ? ?/sec    1.01    629.0±0.64µs        ? ?/sec
take: single_boolean, 8192, nulls: 0.1, selectivity: 0.8                                           1.00    452.4±0.80µs        ? ?/sec    1.02    460.5±0.26µs        ? ?/sec
take: single_dict, 8192, nulls: 0, selectivity: 0.001                                              1.00    258.8±2.72ms        ? ?/sec    1.01    260.6±1.56ms        ? ?/sec
take: single_dict, 8192, nulls: 0, selectivity: 0.01                                               1.01     15.2±0.03ms        ? ?/sec    1.00     15.1±0.03ms        ? ?/sec
take: single_dict, 8192, nulls: 0, selectivity: 0.1                                                1.02      8.3±0.07ms        ? ?/sec    1.00      8.1±0.05ms        ? ?/sec
take: single_dict, 8192, nulls: 0, selectivity: 0.8                                                1.00      4.5±0.02ms        ? ?/sec    1.01      4.5±0.04ms        ? ?/sec
take: single_dict, 8192, nulls: 0.1, selectivity: 0.001                                            1.01    250.3±3.18ms        ? ?/sec    1.00    247.6±1.73ms        ? ?/sec
take: single_dict, 8192, nulls: 0.1, selectivity: 0.01                                             1.00     14.5±0.03ms        ? ?/sec    1.00     14.4±0.04ms        ? ?/sec
take: single_dict, 8192, nulls: 0.1, selectivity: 0.1                                              1.00      8.0±0.05ms        ? ?/sec    1.02      8.2±0.05ms        ? ?/sec
take: single_dict, 8192, nulls: 0.1, selectivity: 0.8                                              1.00      4.3±0.02ms        ? ?/sec    1.01      4.3±0.02ms        ? ?/sec
take: single_fsb16, 8192, nulls: 0, selectivity: 0.001                                             1.38     14.9±0.13ms        ? ?/sec    1.00     10.8±0.07ms        ? ?/sec
take: single_fsb16, 8192, nulls: 0, selectivity: 0.01                                              1.19   1975.6±8.19µs        ? ?/sec    1.00  1653.7±11.16µs        ? ?/sec
take: single_fsb16, 8192, nulls: 0, selectivity: 0.1                                               1.00    806.6±3.02µs        ? ?/sec    1.03    832.0±1.40µs        ? ?/sec
take: single_fsb16, 8192, nulls: 0, selectivity: 0.8                                               1.00    528.0±1.92µs        ? ?/sec    1.00    528.6±0.73µs        ? ?/sec
take: single_fsb16, 8192, nulls: 0.1, selectivity: 0.001                                           1.24     21.1±0.08ms        ? ?/sec    1.00     17.0±0.06ms        ? ?/sec
take: single_fsb16, 8192, nulls: 0.1, selectivity: 0.01                                            1.08      3.2±0.01ms        ? ?/sec    1.00      2.9±0.01ms        ? ?/sec
take: single_fsb16, 8192, nulls: 0.1, selectivity: 0.1                                             1.00   1092.6±2.34µs        ? ?/sec    1.06   1157.1±3.79µs        ? ?/sec
take: single_fsb16, 8192, nulls: 0.1, selectivity: 0.8                                             1.00    740.2±1.02µs        ? ?/sec    1.02    756.5±1.26µs        ? ?/sec
take: single_fsb32, 8192, nulls: 0, selectivity: 0.001                                             1.38     15.6±0.15ms        ? ?/sec    1.00     11.3±0.12ms        ? ?/sec
take: single_fsb32, 8192, nulls: 0, selectivity: 0.01                                              1.16      2.6±0.01ms        ? ?/sec    1.00      2.3±0.01ms        ? ?/sec
take: single_fsb32, 8192, nulls: 0, selectivity: 0.1                                               1.00      2.2±0.00ms        ? ?/sec    1.01      2.2±0.00ms        ? ?/sec
take: single_fsb32, 8192, nulls: 0, selectivity: 0.8                                               1.00   1605.3±6.07µs        ? ?/sec    1.00   1606.7±3.40µs        ? ?/sec
take: single_fsb32, 8192, nulls: 0.1, selectivity: 0.001                                           1.23     22.4±0.07ms        ? ?/sec    1.00     18.2±0.07ms        ? ?/sec
take: single_fsb32, 8192, nulls: 0.1, selectivity: 0.01                                            1.12      4.0±0.02ms        ? ?/sec    1.00      3.5±0.02ms        ? ?/sec
take: single_fsb32, 8192, nulls: 0.1, selectivity: 0.1                                             1.00      2.3±0.00ms        ? ?/sec    1.07      2.5±0.00ms        ? ?/sec
take: single_fsb32, 8192, nulls: 0.1, selectivity: 0.8                                             1.00   1753.0±3.69µs        ? ?/sec    1.04   1829.7±5.28µs        ? ?/sec
take: single_fsl4, 8192, nulls: 0, selectivity: 0.001                                              1.12     37.8±0.14ms        ? ?/sec    1.00     33.7±0.10ms        ? ?/sec
take: single_fsl4, 8192, nulls: 0, selectivity: 0.01                                               1.06      5.4±0.02ms        ? ?/sec    1.00      5.1±0.01ms        ? ?/sec
take: single_fsl4, 8192, nulls: 0, selectivity: 0.1                                                1.00      2.2±0.00ms        ? ?/sec    1.03      2.2±0.00ms        ? ?/sec
take: single_fsl4, 8192, nulls: 0, selectivity: 0.8                                                1.00   1322.8±2.33µs        ? ?/sec    1.00   1323.2±5.35µs        ? ?/sec
take: single_fsl4, 8192, nulls: 0.1, selectivity: 0.001                                            1.05     58.3±0.21ms        ? ?/sec    1.00     55.6±0.17ms        ? ?/sec
take: single_fsl4, 8192, nulls: 0.1, selectivity: 0.01                                             1.02     10.8±0.02ms        ? ?/sec    1.00     10.5±0.02ms        ? ?/sec
take: single_fsl4, 8192, nulls: 0.1, selectivity: 0.1                                              1.00      5.1±0.01ms        ? ?/sec    1.05      5.3±0.01ms        ? ?/sec
take: single_fsl4, 8192, nulls: 0.1, selectivity: 0.8                                              1.00      4.4±0.01ms        ? ?/sec    1.01      4.4±0.01ms        ? ?/sec
take: single_list, 8192, nulls: 0, selectivity: 0.001                                              1.10     47.4±0.27ms        ? ?/sec    1.00     43.3±0.05ms        ? ?/sec
take: single_list, 8192, nulls: 0, selectivity: 0.01                                               1.06      9.4±0.03ms        ? ?/sec    1.00      8.9±0.15ms        ? ?/sec
take: single_list, 8192, nulls: 0, selectivity: 0.1                                                1.00      5.5±0.02ms        ? ?/sec    1.02      5.6±0.02ms        ? ?/sec
take: single_list, 8192, nulls: 0, selectivity: 0.8                                                1.00      3.8±0.01ms        ? ?/sec    1.00      3.8±0.02ms        ? ?/sec
take: single_list, 8192, nulls: 0.1, selectivity: 0.001                                            1.08     54.4±0.25ms        ? ?/sec    1.00     50.2±0.10ms        ? ?/sec
take: single_list, 8192, nulls: 0.1, selectivity: 0.01                                             1.06     11.0±0.03ms        ? ?/sec    1.00     10.3±0.15ms        ? ?/sec
take: single_list, 8192, nulls: 0.1, selectivity: 0.1                                              1.00      6.2±0.02ms        ? ?/sec    1.05      6.5±0.03ms        ? ?/sec
take: single_list, 8192, nulls: 0.1, selectivity: 0.8                                              1.00      4.5±0.02ms        ? ?/sec    1.02      4.6±0.02ms        ? ?/sec
take: single_ree, 8192, nulls: 0, selectivity: 0.001                                               1.08     35.3±0.18ms        ? ?/sec    1.00     32.6±0.20ms        ? ?/sec
take: single_ree, 8192, nulls: 0, selectivity: 0.01                                                1.05      8.3±0.01ms        ? ?/sec    1.00      7.9±0.02ms        ? ?/sec
take: single_ree, 8192, nulls: 0, selectivity: 0.1                                                 1.03      4.7±0.01ms        ? ?/sec    1.00      4.5±0.00ms        ? ?/sec
take: single_ree, 8192, nulls: 0, selectivity: 0.8                                                 1.00      4.7±0.00ms        ? ?/sec    1.00      4.7±0.00ms        ? ?/sec
take: single_ree, 8192, nulls: 0.1, selectivity: 0.001                                             1.06     42.7±0.14ms        ? ?/sec    1.00     40.3±0.06ms        ? ?/sec
take: single_ree, 8192, nulls: 0.1, selectivity: 0.01                                              1.05     10.5±0.01ms        ? ?/sec    1.00     10.0±0.01ms        ? ?/sec
take: single_ree, 8192, nulls: 0.1, selectivity: 0.1                                               1.02      6.0±0.01ms        ? ?/sec    1.00      5.9±0.01ms        ? ?/sec
take: single_ree, 8192, nulls: 0.1, selectivity: 0.8                                               1.00      5.9±0.00ms        ? ?/sec    1.00      5.9±0.01ms        ? ?/sec
take: single_utf8, 8192, nulls: 0, selectivity: 0.001                                              1.18     30.4±0.17ms        ? ?/sec    1.00     25.8±0.10ms        ? ?/sec
take: single_utf8, 8192, nulls: 0, selectivity: 0.01                                               1.05     13.0±0.03ms        ? ?/sec    1.00     12.4±0.03ms        ? ?/sec
take: single_utf8, 8192, nulls: 0, selectivity: 0.1                                                1.00     13.2±0.20ms        ? ?/sec    1.20     15.8±0.20ms        ? ?/sec
take: single_utf8, 8192, nulls: 0, selectivity: 0.8                                                1.05     14.8±0.32ms        ? ?/sec    1.00     14.0±0.22ms        ? ?/sec
take: single_utf8, 8192, nulls: 0.1, selectivity: 0.001                                            1.06     39.4±0.16ms        ? ?/sec    1.00     37.1±0.14ms        ? ?/sec
take: single_utf8, 8192, nulls: 0.1, selectivity: 0.01                                             1.00     12.4±0.05ms        ? ?/sec    1.10     13.7±0.06ms        ? ?/sec
take: single_utf8, 8192, nulls: 0.1, selectivity: 0.1                                              1.00     11.6±0.14ms        ? ?/sec    1.21     13.9±0.30ms        ? ?/sec
take: single_utf8, 8192, nulls: 0.1, selectivity: 0.8                                              1.00     12.0±0.18ms        ? ?/sec    1.03     12.3±0.24ms        ? ?/sec
take: single_utf8view, 8192, nulls: 0, selectivity: 0.001                                          3.74     16.4±0.06ms        ? ?/sec    1.00      4.4±0.03ms        ? ?/sec
take: single_utf8view, 8192, nulls: 0, selectivity: 0.01                                           1.57      3.2±0.01ms        ? ?/sec    1.00      2.0±0.01ms        ? ?/sec
take: single_utf8view, 8192, nulls: 0, selectivity: 0.1                                            1.00      3.4±0.00ms        ? ?/sec    1.01      3.5±0.01ms        ? ?/sec
take: single_utf8view, 8192, nulls: 0, selectivity: 0.8                                            1.00    822.5±1.56µs        ? ?/sec    1.03    846.4±1.54µs        ? ?/sec
take: single_utf8view, 8192, nulls: 0.1, selectivity: 0.001                                        2.43     21.5±0.10ms        ? ?/sec    1.00      8.8±0.08ms        ? ?/sec
take: single_utf8view, 8192, nulls: 0.1, selectivity: 0.01                                         1.56      4.1±0.01ms        ? ?/sec    1.00      2.6±0.01ms        ? ?/sec
take: single_utf8view, 8192, nulls: 0.1, selectivity: 0.1                                          1.00      3.6±0.01ms        ? ?/sec    1.04      3.7±0.01ms        ? ?/sec
take: single_utf8view, 8192, nulls: 0.1, selectivity: 0.8                                          1.00   1014.5±2.75µs        ? ?/sec    1.05   1069.9±2.42µs        ? ?/sec

Per-runner information
coalesce_kernels — shard 1/1

Node: gk3-benchmark-cluster-nap-w5rqtefr-378755d1-ld4w

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

uname:

Linux bench-c6619731120-4404-xr9dw 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 coalesce_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 1590.4s
Peak memory 61.7 MiB
Avg memory 21.1 MiB
CPU user 1518.4s
CPU sys 67.2s
Peak spill 0 B

branch

Metric Value
Wall time 1575.3s
Peak memory 61.0 MiB
Avg memory 21.4 MiB
CPU user 1506.0s
CPU sys 67.9s
Peak spill 0 B

File an issue against this benchmark runner

Keep threshold boundaries and out-of-bounds atomicity coverage in table-driven tests while removing duplicate setup.
@Rich-T-kid

Copy link
Copy Markdown
Contributor Author

run benchmark coalesce_kernels

env:
BENCH_FILTER: "^take: (primitive|.*(utf8view|binaryview))"

@adriangbot

Copy link
Copy Markdown

🤖 Benchmark starting (GKE) | trigger

Target: coalesce_kernels

Sharding factor: 1 (1 workers).

Comparing rich-T-kid/coalescer-interleave (9da5e89) to b65bab9 (merge-base) diff

Run configuration
run benchmark coalesce_kernels
env:
  BENCH_FILTER: '^take: (primitive|.*(utf8view|binaryview))'
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: coalesce_kernels

Comparing rich-T-kid/coalescer-interleave (9da5e89) to b65bab9 (merge-base) diff

Run configuration
run benchmark coalesce_kernels
env:
  BENCH_FILTER: '^take: (primitive|.*(utf8view|binaryview))'
shards: 1
Details
group                                                                                             base                                   changed
-----                                                                                             ----                                   -------
take: mixed_binaryview (max_string_len=128), 8192, nulls: 0, selectivity: 0.001                   4.59     14.9±0.08ms        ? ?/sec    1.00      3.3±0.03ms        ? ?/sec
take: mixed_binaryview (max_string_len=128), 8192, nulls: 0, selectivity: 0.01                    1.47      3.3±0.01ms        ? ?/sec    1.00      2.2±0.01ms        ? ?/sec
take: mixed_binaryview (max_string_len=128), 8192, nulls: 0, selectivity: 0.1                     1.00      2.7±0.01ms        ? ?/sec    1.01      2.7±0.01ms        ? ?/sec
take: mixed_binaryview (max_string_len=128), 8192, nulls: 0, selectivity: 0.8                     1.00   1922.6±3.56µs        ? ?/sec    1.01  1942.2±10.78µs        ? ?/sec
take: mixed_binaryview (max_string_len=128), 8192, nulls: 0.1, selectivity: 0.001                 2.42     21.2±0.07ms        ? ?/sec    1.00      8.8±0.04ms        ? ?/sec
take: mixed_binaryview (max_string_len=128), 8192, nulls: 0.1, selectivity: 0.01                  1.45      4.3±0.01ms        ? ?/sec    1.00      3.0±0.01ms        ? ?/sec
take: mixed_binaryview (max_string_len=128), 8192, nulls: 0.1, selectivity: 0.1                   1.01      2.9±0.01ms        ? ?/sec    1.00      2.9±0.01ms        ? ?/sec
take: mixed_binaryview (max_string_len=128), 8192, nulls: 0.1, selectivity: 0.8                   1.01    820.1±1.27µs        ? ?/sec    1.00    812.9±1.72µs        ? ?/sec
take: mixed_binaryview (max_string_len=20), 8192, nulls: 0, selectivity: 0.001                    5.49     14.4±0.07ms        ? ?/sec    1.00      2.6±0.04ms        ? ?/sec
take: mixed_binaryview (max_string_len=20), 8192, nulls: 0, selectivity: 0.01                     2.07      2.4±0.02ms        ? ?/sec    1.00   1144.7±6.98µs        ? ?/sec
take: mixed_binaryview (max_string_len=20), 8192, nulls: 0, selectivity: 0.1                      1.00  1611.4±12.03µs        ? ?/sec    1.01   1621.7±3.60µs        ? ?/sec
take: mixed_binaryview (max_string_len=20), 8192, nulls: 0, selectivity: 0.8                      1.00   1100.3±3.59µs        ? ?/sec    1.00   1102.8±4.00µs        ? ?/sec
take: mixed_binaryview (max_string_len=20), 8192, nulls: 0.1, selectivity: 0.001                  2.51     20.4±0.03ms        ? ?/sec    1.00      8.1±0.03ms        ? ?/sec
take: mixed_binaryview (max_string_len=20), 8192, nulls: 0.1, selectivity: 0.01                   1.77      3.5±0.02ms        ? ?/sec    1.00  1952.9±14.44µs        ? ?/sec
take: mixed_binaryview (max_string_len=20), 8192, nulls: 0.1, selectivity: 0.1                    1.01   1925.7±3.68µs        ? ?/sec    1.00   1900.0±3.62µs        ? ?/sec
take: mixed_binaryview (max_string_len=20), 8192, nulls: 0.1, selectivity: 0.8                    1.01    819.4±0.99µs        ? ?/sec    1.00    813.7±1.58µs        ? ?/sec
take: mixed_utf8view (max_string_len=128), 8192, nulls: 0, selectivity: 0.001                     4.61     14.8±0.05ms        ? ?/sec    1.00      3.2±0.00ms        ? ?/sec
take: mixed_utf8view (max_string_len=128), 8192, nulls: 0, selectivity: 0.01                      1.42      3.3±0.01ms        ? ?/sec    1.00      2.3±0.01ms        ? ?/sec
take: mixed_utf8view (max_string_len=128), 8192, nulls: 0, selectivity: 0.1                       1.00      2.6±0.01ms        ? ?/sec    1.01      2.7±0.01ms        ? ?/sec
take: mixed_utf8view (max_string_len=128), 8192, nulls: 0, selectivity: 0.8                       1.00   1908.7±2.88µs        ? ?/sec    1.01   1922.9±2.79µs        ? ?/sec
take: mixed_utf8view (max_string_len=128), 8192, nulls: 0.1, selectivity: 0.001                   2.41     21.0±0.05ms        ? ?/sec    1.00      8.7±0.03ms        ? ?/sec
take: mixed_utf8view (max_string_len=128), 8192, nulls: 0.1, selectivity: 0.01                    1.42      4.3±0.01ms        ? ?/sec    1.00      3.1±0.01ms        ? ?/sec
take: mixed_utf8view (max_string_len=128), 8192, nulls: 0.1, selectivity: 0.1                     1.01      2.9±0.00ms        ? ?/sec    1.00      2.9±0.01ms        ? ?/sec
take: mixed_utf8view (max_string_len=128), 8192, nulls: 0.1, selectivity: 0.8                     1.00    818.1±0.77µs        ? ?/sec    1.00    814.2±0.77µs        ? ?/sec
take: mixed_utf8view (max_string_len=20), 8192, nulls: 0, selectivity: 0.001                      5.51     14.1±0.05ms        ? ?/sec    1.00      2.6±0.00ms        ? ?/sec
take: mixed_utf8view (max_string_len=20), 8192, nulls: 0, selectivity: 0.01                       2.22      2.4±0.01ms        ? ?/sec    1.00   1069.7±3.60µs        ? ?/sec
take: mixed_utf8view (max_string_len=20), 8192, nulls: 0, selectivity: 0.1                        1.00   1545.6±3.17µs        ? ?/sec    1.01   1561.6±3.42µs        ? ?/sec
take: mixed_utf8view (max_string_len=20), 8192, nulls: 0, selectivity: 0.8                        1.00    549.0±0.95µs        ? ?/sec    1.01    554.5±0.65µs        ? ?/sec
take: mixed_utf8view (max_string_len=20), 8192, nulls: 0.1, selectivity: 0.001                    2.52     20.3±0.08ms        ? ?/sec    1.00      8.1±0.03ms        ? ?/sec
take: mixed_utf8view (max_string_len=20), 8192, nulls: 0.1, selectivity: 0.01                     1.80      3.5±0.01ms        ? ?/sec    1.00   1918.8±4.10µs        ? ?/sec
take: mixed_utf8view (max_string_len=20), 8192, nulls: 0.1, selectivity: 0.1                      1.01   1853.8±4.10µs        ? ?/sec    1.00   1843.6±5.32µs        ? ?/sec
take: mixed_utf8view (max_string_len=20), 8192, nulls: 0.1, selectivity: 0.8                      1.01    817.6±0.63µs        ? ?/sec    1.00    812.9±1.26µs        ? ?/sec
take: primitive extra_large_repeat, input: 8192, output: 131072, nulls: 0, biggest: Some(1024)    1.02     11.0±0.02ms        ? ?/sec    1.00     10.7±0.03ms        ? ?/sec
take: primitive, 8192, nulls: 0, selectivity: 0.001                                               6.95     33.8±0.14ms        ? ?/sec    1.00      4.9±0.03ms        ? ?/sec
take: primitive, 8192, nulls: 0, selectivity: 0.01                                                3.28      4.7±0.11ms        ? ?/sec    1.00  1440.0±12.49µs        ? ?/sec
take: primitive, 8192, nulls: 0, selectivity: 0.1                                                 1.42   1725.9±2.22µs        ? ?/sec    1.00   1213.0±0.98µs        ? ?/sec
take: primitive, 8192, nulls: 0, selectivity: 0.8                                                 1.00    856.6±0.74µs        ? ?/sec    1.00    860.1±2.97µs        ? ?/sec
take: primitive, 8192, nulls: 0.1, selectivity: 0.001                                             2.65     48.7±0.07ms        ? ?/sec    1.00     18.4±0.07ms        ? ?/sec
take: primitive, 8192, nulls: 0.1, selectivity: 0.01                                              2.08      7.2±0.07ms        ? ?/sec    1.00      3.5±0.01ms        ? ?/sec
take: primitive, 8192, nulls: 0.1, selectivity: 0.1                                               1.29      2.6±0.00ms        ? ?/sec    1.00      2.0±0.00ms        ? ?/sec
take: primitive, 8192, nulls: 0.1, selectivity: 0.8                                               1.00   1520.5±2.56µs        ? ?/sec    1.02   1546.7±4.55µs        ? ?/sec
take: single_binaryview, 8192, nulls: 0, selectivity: 0.001                                       3.65     16.2±0.13ms        ? ?/sec    1.00      4.4±0.04ms        ? ?/sec
take: single_binaryview, 8192, nulls: 0, selectivity: 0.01                                        1.59      3.2±0.01ms        ? ?/sec    1.00   1996.6±4.14µs        ? ?/sec
take: single_binaryview, 8192, nulls: 0, selectivity: 0.1                                         1.00      3.3±0.01ms        ? ?/sec    1.01      3.3±0.01ms        ? ?/sec
take: single_binaryview, 8192, nulls: 0, selectivity: 0.8                                         1.00    803.1±0.79µs        ? ?/sec    1.00    806.1±0.62µs        ? ?/sec
take: single_binaryview, 8192, nulls: 0.1, selectivity: 0.001                                     2.40     21.4±0.06ms        ? ?/sec    1.00      8.9±0.10ms        ? ?/sec
take: single_binaryview, 8192, nulls: 0.1, selectivity: 0.01                                      1.60      4.2±0.01ms        ? ?/sec    1.00      2.6±0.01ms        ? ?/sec
take: single_binaryview, 8192, nulls: 0.1, selectivity: 0.1                                       1.00      3.5±0.01ms        ? ?/sec    1.00      3.5±0.01ms        ? ?/sec
take: single_binaryview, 8192, nulls: 0.1, selectivity: 0.8                                       1.00   1015.2±1.68µs        ? ?/sec    1.01   1024.3±1.30µs        ? ?/sec
take: single_utf8view, 8192, nulls: 0, selectivity: 0.001                                         3.72     16.2±0.04ms        ? ?/sec    1.00      4.4±0.01ms        ? ?/sec
take: single_utf8view, 8192, nulls: 0, selectivity: 0.01                                          1.59      3.1±0.01ms        ? ?/sec    1.00   1967.5±4.76µs        ? ?/sec
take: single_utf8view, 8192, nulls: 0, selectivity: 0.1                                           1.00      3.2±0.00ms        ? ?/sec    1.01      3.3±0.00ms        ? ?/sec
take: single_utf8view, 8192, nulls: 0, selectivity: 0.8                                           1.00    798.7±2.10µs        ? ?/sec    1.01    807.7±2.55µs        ? ?/sec
take: single_utf8view, 8192, nulls: 0.1, selectivity: 0.001                                       2.42     21.3±0.06ms        ? ?/sec    1.00      8.8±0.10ms        ? ?/sec
take: single_utf8view, 8192, nulls: 0.1, selectivity: 0.01                                        1.58      4.1±0.01ms        ? ?/sec    1.00      2.6±0.01ms        ? ?/sec
take: single_utf8view, 8192, nulls: 0.1, selectivity: 0.1                                         1.00      3.5±0.01ms        ? ?/sec    1.00      3.5±0.01ms        ? ?/sec
take: single_utf8view, 8192, nulls: 0.1, selectivity: 0.8                                         1.01   1033.3±1.40µs        ? ?/sec    1.00   1022.4±4.25µs        ? ?/sec

Per-runner information
coalesce_kernels — shard 1/1

Node: gk3-benchmark-cluster-nap-1pkbfl73-8fc9a82d-84xd

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

uname:

Linux bench-c6662170060-4521-x6wp6 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 coalesce_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 625.1s
Peak memory 22.5 MiB
Avg memory 16.8 MiB
CPU user 619.5s
CPU sys 0.3s
Peak spill 0 B

branch

Metric Value
Wall time 625.1s
Peak memory 26.4 MiB
Avg memory 16.8 MiB
CPU user 622.5s
CPU sys 0.3s
Peak spill 0 B

File an issue against this benchmark runner

@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 and @mbutrovich -- this is a really neat PR and I thank you for sticking with it. The performance report is pretty incredible

I had some small minor comments but nothing I think is required

Comment thread arrow-select/src/coalesce.rs Resolved
Comment thread arrow-select/src/coalesce/primitive.rs Resolved
Comment thread arrow-select/src/coalesce/primitive.rs Resolved
Comment thread arrow-select/src/coalesce/byte_view.rs Resolved
Comment thread arrow-select/src/coalesce/byte_view.rs Resolved
Comment thread arrow-select/src/coalesce/byte_view.rs Resolved
@Rich-T-kid

Copy link
Copy Markdown
Contributor Author

thanks @alamb @mbutrovich

Merged via the queue into apache:main with commit b8d7b68 Nov 12, 2026
20 checks passed
@alamb

alamb commented Nov 12, 2026

Copy link
Copy Markdown
Contributor

Let the race begin

Surajsuthar pushed a commit to Surajsuthar/arrow-rs that referenced this pull request Nov 14, 2026
# Which issue does this PR close?

Closes apache#12210.

# Rationale for this change

The sparse ByteView indexed-copy path added in apache#11174 checks the
destination buffer boundary for every selected non-inline value, even
though it already computes the total selected byte length before
copying.

# What changes are included in this PR?

Before this change, one loop handled both cases. For every selected
non-inline value it computed the destination end, checked whether the
value crossed the buffer limit, potentially finalized the buffer and
allocated another one, and then copied the value.

The caller already knows the total selected byte length. This change
uses that total once before the loop:

- If all selected bytes fit, the common path copies them into one buffer
without checking the split boundary for every value.
- If they do not fit, it calls a cold helper containing the existing
split-buffer loop.

The diff looks larger because it adds the specialized common loop and
moves the old general loop into the helper; the split-buffer behavior is
unchanged. In generated code, the common loop goes from two destination
checks to one: the split-buffer threshold branch is removed, while
`Vec::extend_from_slice`'s capacity guard remains.

<details>
<summary>Assembly comparison and reproduction</summary>

Verified at base `b8d7b68bfc` and head `e619f21624` with `rustc 1.99.1`
on `aarch64-apple-darwin`.

Base, before the copy:

```asm
add  x8, x27, x10
lsr  x8, x8, apache#31
cbz  x8, ...       // continue when dst_len + value_len fits
```

Both revisions retain the `Vec` capacity guard around `memcpy`:

```asm
sub  x8, x8, x21
cmp  x27, x8
b.hi ...           // grow Vec when remaining capacity is too small
```

At the PR head, the first sequence is absent from the common loop. To
check either revision:

```bash
RUSTFLAGS='-C target-cpu=native' cargo rustc \
  -p arrow --bench coalesce_kernels --release \
  --features test_utils -- --emit=asm

BIN=$(rg --files target/release/deps | \
  rg '/coalesce_kernels-[^.]+$' | head -1)
objdump -d "$BIN" | rustfilt | less
```

Search the disassembly for `append_indexed_views_and_copy_strings`. Run
the commands at `b8d7b68bfc` and `e619f21624` to compare the two loops.
Install `rustfilt` with `cargo install rustfilt` if needed.

</details>

The existing overflow checks and maximum buffer size are preserved.

# Are these changes tested?

`test_copy_rows_by_indices_compacts_into_single_buffer` sets
`max_buffer_size` equal to the selected byte length, covering the
exact-fit fast path and validating the output layout. The existing
split-buffer test covers `selected_bytes > max_buffer_size`, so both
sides of the new dispatch are exercised.

The final reruns compare the PR head `e619f21624` with its parent
`b8d7b68bfc`.

| Benchmark | Result | Runs |
| --- | --- | --- |
| `coalesce_kernels` (ARM64) | 1% selections are 7-13% faster; 0.1%
selections are 2-5% faster |
[results](apache#12212 (comment))
|
| `coalesce_kernels` (AMD64) | Seven cases are 2-18% faster; BinaryView
with no nulls at 1% is 3-4% slower in two runs | [full
run](apache#12212 (comment)),
[rerun](apache#12212 (comment))
|
| Focused Utf8View rerun (ARM64) | All four cases are 3-10% faster |
[results](apache#12212 (comment))
|
| Focused Utf8View rerun (AMD64) | All four cases are 7-15% faster |
[results](apache#12212 (comment))
|

# Are there any significant user-facing changes?

No.
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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Optimize BatchCoalescer::push_batch_with_indices

4 participants