Skip to content

Commit cbadec7

Browse files
authored
Add benchmark for converting StringViewArray with mixed short and long strings (#8015)
### Description Add benchmark case for performance comparison in #7917 .
1 parent 2418c59 commit cbadec7

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

arrow/benches/row_format.rs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ use arrow::row::{RowConverter, SortField};
2525
use arrow::util::bench_util::{
2626
create_boolean_array, create_dict_from_values, create_primitive_array,
2727
create_string_array_with_len, create_string_dict_array, create_string_view_array_with_len,
28+
create_string_view_array_with_max_len,
2829
};
2930
use arrow::util::data_gen::create_random_array;
3031
use arrow_array::types::Int32Type;
@@ -127,6 +128,12 @@ fn row_bench(c: &mut Criterion) {
127128
let cols = vec![Arc::new(create_string_view_array_with_len(4096, 0.5, 100, false)) as ArrayRef];
128129
do_bench(c, "4096 string view(100, 0.5)", cols);
129130

131+
let cols = vec![Arc::new(create_string_view_array_with_max_len(4096, 0., 100)) as ArrayRef];
132+
do_bench(c, "4096 string view(1..100, 0)", cols);
133+
134+
let cols = vec![Arc::new(create_string_view_array_with_max_len(4096, 0.5, 100)) as ArrayRef];
135+
do_bench(c, "4096 string view(1..100, 0.5)", cols);
136+
130137
let cols = vec![Arc::new(create_string_dict_array::<Int32Type>(4096, 0., 10)) as ArrayRef];
131138
do_bench(c, "4096 string_dictionary(10, 0)", cols);
132139

0 commit comments

Comments
 (0)