Skip to content

Commit 9ead0d1

Browse files
authored
Add concatenate kernel benchmark for StringViewArray (#7617)
# Which issue does this PR close? - Related to #7614 # Rationale for this change We expect #7614 to improve concat performance, but we don't have any concat benchmarks for StringViewArray Let's fix that # What changes are included in this PR? 1. Add a `concat` benchmark for StringViewArray # Are there any user-facing changes? No this is an internal benchmarking tool only
1 parent 9e575bd commit 9ead0d1

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

arrow/benches/concatenate_kernel.rs

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -145,6 +145,20 @@ fn add_benchmark(c: &mut Criterion) {
145145
});
146146
}
147147

148+
// String view arrays
149+
for null_density in [0.0, 0.2] {
150+
// Any strings less than 12 characters are stored as prefix only, so specially
151+
// benchmark cases that have different mixes of lengths.
152+
for (name, str_len) in [("all_inline", 12), ("", 20), ("", 128)] {
153+
let array = create_string_view_array_with_len(8192, null_density, str_len, false);
154+
let arrays = (0..10).map(|_| &array as &dyn Array).collect::<Vec<_>>();
155+
let id = format!(
156+
"concat utf8_view {name} max_str_len={str_len} null_density={null_density}"
157+
);
158+
c.bench_function(&id, |b| b.iter(|| bench_concat_arrays(&arrays)));
159+
}
160+
}
161+
148162
let v1 = create_string_array_with_len::<i32>(10, 0.0, 20);
149163
let v1 = create_dict_from_values::<Int32Type>(1024, 0.0, &v1);
150164
let v2 = create_string_array_with_len::<i32>(10, 0.0, 20);

0 commit comments

Comments
 (0)