You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@arrow.apache.org by gi...@apache.org on 2026/10/05 01:15:16 UTC
(arrow-rs) 01/01: bench(parquet): add a list benchmark without nulls or empty lists (#11375)
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-11375-ef3c950c1c17a552bf146d841da50ae01536d675
in repository https://gitbox.apache.org/repos/asf/arrow-rs.git
commit 2741db581b707b18515034b7adf2f2f24efe303e
Author: Neil Conway <ne...@gmail.com>
AuthorDate: Mon Oct 5 01:15:04 2026 +0000
bench(parquet): add a list benchmark without nulls or empty lists (#11375)
# Which issue does this PR close?
- N/A
# Rationale for this change
Columns of lists with no nulls, empty lists, or null elements are common
in practice, but were not covered by the existing benchmarks.
# What changes are included in this PR?
* Add `Int32List` case with no nulls, empty lists, and 0% null density
# Are these changes tested?
Benchmark addition only.
# Are there any significant user-facing changes?
No.
---
parquet/benches/arrow_reader.rs | 13 +++++++++++--
1 file changed, 11 insertions(+), 2 deletions(-)
diff --git a/parquet/benches/arrow_reader.rs b/parquet/benches/arrow_reader.rs
index 1d30076903..dadd4516cb 100644
--- a/parquet/benches/arrow_reader.rs
+++ b/parquet/benches/arrow_reader.rs
@@ -803,6 +803,7 @@ fn build_string_list_page_iterator(
fn build_int32_list_page_iterator(
column_desc: ColumnDescPtr,
null_density: f32,
+ min_list_len: usize,
) -> impl PageIterator + Clone {
let max_def_level = column_desc.max_def_level();
let max_rep_level = column_desc.max_rep_level();
@@ -823,7 +824,7 @@ fn build_int32_list_page_iterator(
def_levels.push(0);
continue;
}
- let len = rng.random_range(0..MAX_LIST_LEN);
+ let len = rng.random_range(min_list_len..MAX_LIST_LEN);
if len == 0 {
def_levels.push(1);
continue;
@@ -2636,7 +2637,7 @@ fn add_benches(c: &mut Criterion) {
("90pct NULLs", 0.9),
("99pct NULLs", 0.99),
] {
- let list_data = build_int32_list_page_iterator(int32_list_desc.clone(), null_density);
+ let list_data = build_int32_list_page_iterator(int32_list_desc.clone(), null_density, 0);
group.bench_function(label, |b| {
b.iter(|| {
let reader = create_int32_list_reader(list_data.clone(), int32_list_desc.clone());
@@ -2645,6 +2646,14 @@ fn add_benches(c: &mut Criterion) {
assert_eq!(count, EXPECTED_VALUE_COUNT);
});
}
+ let list_data = build_int32_list_page_iterator(int32_list_desc.clone(), 0.0, 1);
+ group.bench_function("no NULLs or empty lists", |b| {
+ b.iter(|| {
+ let reader = create_int32_list_reader(list_data.clone(), int32_list_desc.clone());
+ count = bench_array_reader(reader);
+ });
+ assert_eq!(count, EXPECTED_VALUE_COUNT);
+ });
group.finish();
let mut group = c.benchmark_group("arrow_array_reader/ListArray/Fixed32List");