This is an automated email from the ASF dual-hosted git repository.
github-merge-queue[bot] pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/arrow-rs.git
The following commit(s) were added to refs/heads/main by this push:
new d65329d3e7 Add all-empty string case to the parquet arrow_writer
benchmark (#12140)
d65329d3e7 is described below
commit d65329d3e71f4276ce41c8675446d178cecfc1fa
Author: Aleksandar Zecevic <[email protected]>
AuthorDate: Mon Nov 16 15:11:44 2026 +0000
Add all-empty string case to the parquet arrow_writer benchmark (#12140)
# Which issue does this PR close?
https://github.com/apache/arrow-rs/issues/12269
# Rationale for this change
Benchmark for the case of a large empty buffer. There is a real
regression in glibc >=2.35 on x86 AVX512.
# What changes are included in this PR?
Just a benchmark case as recommended in `CONTRIBUTING.md`.
# Are these changes tested?
# Are there any significant user-facing changes?
No.
# AI use
An AI coding agent wrote the code. I have reviewed it and verified the
benchmark results.
---------
Co-authored-by: RIchard Baah <[email protected]>
---
parquet/benches/arrow_writer.rs | 16 ++++++++++++++++
1 file changed, 16 insertions(+)
diff --git a/parquet/benches/arrow_writer.rs b/parquet/benches/arrow_writer.rs
index b27714fe90..99d975b3a6 100644
--- a/parquet/benches/arrow_writer.rs
+++ b/parquet/benches/arrow_writer.rs
@@ -765,6 +765,17 @@ fn create_string_bench_batch_non_null(
)?)
}
+fn create_empty_string_bench_batch(size: usize) -> Result<RecordBatch> {
+ let schema = Schema::new(vec![Field::new("_1", DataType::Utf8, false)]);
+ // Gives an all-empty array a values buffer
+ // without an allocation.
+ let array = StringArray::from_iter_values(std::iter::repeat_n("", size));
+ Ok(RecordBatch::try_new(
+ Arc::new(schema),
+ vec![Arc::new(array)],
+ )?)
+}
+
fn create_bool_bench_batch(
size: usize,
null_density: f32,
@@ -1333,6 +1344,11 @@ fn create_batches() -> Vec<BatchBenchmark> {
create_string_bench_batch_non_null(BATCH_SIZE, 0.25, 0.75).unwrap()
);
+ push_batch!(
+ "string_empty",
+ create_empty_string_bench_batch(BATCH_SIZE).unwrap()
+ );
+
// Run-end-encoded — high-cardinality / short-run regime (random runs).
push_batch!(
"string_ree",