Skip to content

Commit

Permalink
Add other benchmarks
Browse files Browse the repository at this point in the history
  • Loading branch information
alamb committed Aug 21, 2024
1 parent 651d4d4 commit e7347ee
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions arrow/benches/comparison_kernels.rs
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,6 @@ fn add_benchmark(c: &mut Criterion) {
let string_right = StringArray::from_iter(array_gen);
let string_view_right = StringViewArray::from_iter(string_right.iter());

let string_view_scalar = StringViewArray::new_scalar("xxxx");
let string_scalar = StringArray::new_scalar("xxxx");
c.bench_function("eq scalar StringArray", |b| {
b.iter(|| eq(&string_scalar, &string_left).unwrap())
Expand All @@ -193,7 +192,19 @@ fn add_benchmark(c: &mut Criterion) {
})
});

c.bench_function("eq scalar StringViewArray", |b| {
// StringViewArray has special handling for strings with length <= 12 and length <= 4
let string_view_scalar = StringViewArray::new_scalar("xxxx");
c.bench_function("eq scalar StringViewArray 4 bytes", |b| {
b.iter(|| eq(&string_view_scalar, &string_view_left).unwrap())
});

let string_view_scalar = StringViewArray::new_scalar("xxxxxx");
c.bench_function("eq scalar StringViewArray 6 bytes", |b| {
b.iter(|| eq(&string_view_scalar, &string_view_left).unwrap())
});

let string_view_scalar = StringViewArray::new_scalar("xxxxxxxxxxxxx");
c.bench_function("eq scalar StringViewArray 13 bytes", |b| {
b.iter(|| eq(&string_view_scalar, &string_view_left).unwrap())
});

Expand Down

0 comments on commit e7347ee

Please sign in to comment.