Skip to content

Commit

Permalink
Add low cardinality benchmarks
Browse files Browse the repository at this point in the history
  • Loading branch information
tustvold committed Sep 15, 2023
1 parent 98dbedb commit 47a8e43
Showing 1 changed file with 17 additions and 1 deletion.
18 changes: 17 additions & 1 deletion arrow/benches/row_format.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@ use arrow::array::ArrayRef;
use arrow::datatypes::{Int64Type, UInt64Type};
use arrow::row::{RowConverter, SortField};
use arrow::util::bench_util::{
create_primitive_array, create_string_array_with_len, create_string_dict_array,
create_dict_from_values, create_primitive_array, create_string_array,
create_string_array_with_len, create_string_dict_array,
};
use arrow_array::types::Int32Type;
use arrow_array::Array;
Expand Down Expand Up @@ -94,6 +95,21 @@ fn row_bench(c: &mut Criterion) {
vec![Arc::new(create_string_dict_array::<Int32Type>(4096, 0.5, 100)) as ArrayRef];
do_bench(c, "4096 string_dictionary(100, 0.5)", cols.clone());

let values = create_string_array::<i32>(10, 0.);
let dict = create_dict_from_values::<Int32Type>(4096, 0., &values);
let cols = vec![Arc::new(dict) as ArrayRef];
do_bench(c, "4096 string_dictionary_low_cardinality(10, 0)", cols);

let values = create_string_array::<i32>(30, 0.);
let dict = create_dict_from_values::<Int32Type>(4096, 0., &values);
let cols = vec![Arc::new(dict) as ArrayRef];
do_bench(c, "4096 string_dictionary_low_cardinality(30, 0)", cols);

let values = create_string_array::<i32>(100, 0.);
let dict = create_dict_from_values::<Int32Type>(4096, 0., &values);
let cols = vec![Arc::new(dict) as ArrayRef];
do_bench(c, "4096 string_dictionary_low_cardinality(100, 0)", cols);

let cols = vec![
Arc::new(create_string_array_with_len::<i32>(4096, 0.5, 20)) as ArrayRef,
Arc::new(create_string_array_with_len::<i32>(4096, 0., 30)) as ArrayRef,
Expand Down

0 comments on commit 47a8e43

Please sign in to comment.