Skip to content

Commit

Permalink
wip: add stringview to interleave benchmark, comment out the rest
Browse files Browse the repository at this point in the history
  • Loading branch information
onursatici committed Dec 3, 2024
1 parent 6472dd8 commit d143706
Showing 1 changed file with 16 additions and 14 deletions.
30 changes: 16 additions & 14 deletions arrow/benches/interleave_kernels.rs
Original file line number Diff line number Diff line change
Expand Up @@ -72,17 +72,19 @@ fn add_benchmark(c: &mut Criterion) {
let string_opt = create_string_array_with_len::<i32>(1024, 0.5, 20);
let values = create_string_array_with_len::<i32>(10, 0.0, 20);
let dict = create_dict_from_values::<Int32Type>(1024, 0.0, &values);
let string_view = create_string_view_array_with_len(1024, 0.5, 50, true);

let values = create_string_array_with_len::<i32>(1024, 0.0, 20);
let sparse_dict = create_sparse_dict_from_values::<Int32Type>(1024, 0.0, &values, 10..20);

let cases: &[(&str, &dyn Array)] = &[
("i32(0.0)", &i32),
("i32(0.5)", &i32_opt),
("str(20, 0.0)", &string),
("str(20, 0.5)", &string_opt),
("dict(20, 0.0)", &dict),
("dict_sparse(20, 0.0)", &sparse_dict),
// ("i32(0.0)", &i32),
// ("i32(0.5)", &i32_opt),
// ("str(20, 0.0)", &string),
// ("str(20, 0.5)", &string_opt),
// ("dict(20, 0.0)", &dict),
// ("dict_sparse(20, 0.0)", &sparse_dict),
("string_view(0.5, 50, true)", &string_view),
];

for (prefix, base) in cases {
Expand All @@ -98,14 +100,14 @@ fn add_benchmark(c: &mut Criterion) {
}
}

for len in [100, 1024, 2048] {
bench_values(
c,
&format!("interleave dict_distinct {len}"),
100,
&[&dict, &sparse_dict],
);
}
// for len in [100, 1024, 2048] {
// bench_values(
// c,
// &format!("interleave dict_distinct {len}"),
// 100,
// &[&dict, &sparse_dict],
// );
// }
}

criterion_group!(benches, add_benchmark);
Expand Down

0 comments on commit d143706

Please sign in to comment.