From 41574dd6ab7ffade5b78b20e4b5012b1edc6c0d3 Mon Sep 17 00:00:00 2001 From: Hippolyte Barraud Date: Wed, 1 Apr 2026 14:44:49 -0400 Subject: [PATCH] feat(parquet): add sparse-column writer benchmarks Add three new benchmark cases to the arrow_writer benchmark suite for evaluating write performance on sparse and all-null data: - `primitive_sparse_99pct_null`: a flat primitive column with 99% nulls, exercising long RLE runs in definition levels. - `list_primitive_sparse_99pct_null`: a list-of-primitive column with 99% nulls, exercising null batching in the list level builder. - `primitive_all_null`: a flat primitive column with 100% nulls, exercising the uniform_levels fast path for entirely-null columns. Baseline results (Apple M1 Max): primitive_sparse_99pct_null/default 40.3 ms primitive_sparse_99pct_null/parquet_2 43.5 ms primitive_sparse_99pct_null/zstd_parquet_2 44.4 ms list_primitive_sparse_99pct_null/default 39.9 ms list_primitive_sparse_99pct_null/parquet_2 39.9 ms list_primitive_sparse_99pct_null/zstd_p2 40.7 ms primitive_all_null/default 38.0 ms primitive_all_null/parquet_2 36.9 ms primitive_all_null/zstd_parquet_2 36.1 ms Signed-off-by: Hippolyte Barraud --- parquet/benches/arrow_writer.rs | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/parquet/benches/arrow_writer.rs b/parquet/benches/arrow_writer.rs index 0ee25873ab60..909d41982523 100644 --- a/parquet/benches/arrow_writer.rs +++ b/parquet/benches/arrow_writer.rs @@ -391,6 +391,15 @@ fn create_batches() -> Vec<(&'static str, RecordBatch)> { let batch = create_list_primitive_bench_batch_non_null(BATCH_SIZE, 0.25, 0.75).unwrap(); batches.push(("list_primitive_non_null", batch)); + let batch = create_primitive_bench_batch(BATCH_SIZE, 0.99, 0.75).unwrap(); + batches.push(("primitive_sparse_99pct_null", batch)); + + let batch = create_list_primitive_bench_batch(BATCH_SIZE, 0.99, 0.75).unwrap(); + batches.push(("list_primitive_sparse_99pct_null", batch)); + + let batch = create_primitive_bench_batch(BATCH_SIZE, 1.0, 0.75).unwrap(); + batches.push(("primitive_all_null", batch)); + batches }