This is an automated email from the ASF dual-hosted git repository. github-merge-queue[bot] pushed a commit to branch gh-readonly-queue/main/pr-12083-6759872cabb7c581c9daa9d9a7f52492e2cedd70 in repository https://gitbox.apache.org/repos/asf/arrow-rs.git
commit 3ac383675a02c466961dd29d20be92a736b842ec Author: Gabriel <[email protected]> AuthorDate: Thu Nov 5 15:28:28 2026 +0000 bench(arrow-ipc): add lz4 compression benchmarks for IPC writer (#12083) Adds some new benches for helping qualify a future change in https://github.com/apache/arrow-rs/pull/12084. The new benchmarks are some `StreamWriter`/`StreamEncoder` cases using `CompressionType::LZ4_FRAME`, including single-threaded and multi-threaded (contended) variants. --- arrow-ipc/benches/ipc_writer.rs | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/arrow-ipc/benches/ipc_writer.rs b/arrow-ipc/benches/ipc_writer.rs index 2af88116ef..f31ba39517 100644 --- a/arrow-ipc/benches/ipc_writer.rs +++ b/arrow-ipc/benches/ipc_writer.rs @@ -68,6 +68,34 @@ fn criterion_benchmark(c: &mut Criterion) { }) }); + for (rows, threads) in [(8192, 1), (65536, 1), (8192, 16), (65536, 16)] { + group.bench_function( + format!("StreamEncoder/encode_10/lz4/rows={rows}/threads={threads}"), + |b| { + let batch = create_batch(rows, true); + b.iter(|| { + std::thread::scope(|s| { + for _ in 0..threads { + s.spawn(|| { + let options = IpcWriteOptions::default() + .try_with_compression(Some(CompressionType::LZ4_FRAME)) + .unwrap(); + let mut encoder = StreamEncoder::try_new_with_options( + batch.schema().as_ref(), + options, + ) + .unwrap(); + for _ in 0..10 { + black_box(encoder.encode(&batch).unwrap()); + } + }); + } + }) + }) + }, + ); + } + group.bench_function("StreamEncoder/encode_10", |b| { let batch = create_batch(8192, true); b.iter(move || {
