Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
84 changes: 84 additions & 0 deletions arrow/benches/row_format.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,10 @@ use arrow::util::bench_util::{
create_boolean_array, create_dict_from_values, create_primitive_array,
create_string_array_with_len, create_string_dict_array, create_string_view_array_with_len,
};
use arrow::util::data_gen::create_random_array;
use arrow_array::types::Int32Type;
use arrow_array::Array;
use arrow_schema::{DataType, Field};
use criterion::Criterion;
use std::{hint, sync::Arc};

Expand Down Expand Up @@ -172,6 +174,88 @@ fn row_bench(c: &mut Criterion) {
];
do_bench(c, "4096 4096 string_dictionary(20, 0.5), string_dictionary(30, 0), string_dictionary(100, 0), i64(0)", cols);

// List

let cols = vec![create_random_array(
&Field::new(
"list",
DataType::List(Arc::new(Field::new_list_field(DataType::UInt64, false))),
false,
),
4096,
0.,
1.0,
)
.unwrap()];
do_bench(c, "4096 list(0) of u64(0)", cols);

let cols = vec![create_random_array(
&Field::new(
"list",
DataType::LargeList(Arc::new(Field::new_list_field(DataType::UInt64, false))),
false,
),
4096,
0.,
1.0,
)
.unwrap()];
do_bench(c, "4096 large_list(0) of u64(0)", cols);

let cols = vec![create_random_array(
&Field::new(
"list",
DataType::List(Arc::new(Field::new_list_field(DataType::UInt64, false))),
false,
),
10,
0.,
1.0,
)
.unwrap()];
do_bench(c, "10 list(0) of u64(0)", cols);

let cols = vec![create_random_array(
&Field::new(
"list",
DataType::LargeList(Arc::new(Field::new_list_field(DataType::UInt64, false))),
false,
),
10,
0.,
1.0,
)
.unwrap()];
do_bench(c, "10 large_list(0) of u64(0)", cols);

let cols = vec![create_random_array(
&Field::new(
"list",
DataType::List(Arc::new(Field::new_list_field(DataType::UInt64, false))),
false,
),
4096,
0.,
1.0,
)
.unwrap()
.slice(10, 20)];
do_bench(c, "4096 list(0) sliced to 10 of u64(0)", cols);

let cols = vec![create_random_array(
&Field::new(
"list",
DataType::LargeList(Arc::new(Field::new_list_field(DataType::UInt64, false))),
false,
),
4096,
0.,
1.0,
)
.unwrap()
.slice(10, 20)];
do_bench(c, "4096 large_list(0) sliced to 10 of u64(0)", cols);

bench_iter(c);
}

Expand Down
Loading