You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@arrow.apache.org by tu...@apache.org on 2022/12/08 16:37:22 UTC
[arrow-rs] branch master updated: Add more comparison benchmarks (#3298)
This is an automated email from the ASF dual-hosted git repository.
tustvold pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/arrow-rs.git
The following commit(s) were added to refs/heads/master by this push:
new bf1cccb3f Add more comparison benchmarks (#3298)
bf1cccb3f is described below
commit bf1cccb3fdab5d9d5c6d759448ba6a96c63f89a1
Author: Raphael Taylor-Davies <17...@users.noreply.github.com>
AuthorDate: Thu Dec 8 16:37:14 2022 +0000
Add more comparison benchmarks (#3298)
---
arrow/benches/comparison_kernels.rs | 45 +++++++++++++++++++++++++++++++++++++
1 file changed, 45 insertions(+)
diff --git a/arrow/benches/comparison_kernels.rs b/arrow/benches/comparison_kernels.rs
index 6599e3725..99229ed0b 100644
--- a/arrow/benches/comparison_kernels.rs
+++ b/arrow/benches/comparison_kernels.rs
@@ -168,6 +168,51 @@ fn add_benchmark(c: &mut Criterion) {
})
});
+ let arr_a = create_primitive_array_with_seed::<Int32Type>(size, 0.0, 42);
+ let arr_b = create_primitive_array_with_seed::<Int32Type>(size, 0.0, 43);
+
+ c.bench_function("eq Int32", |b| b.iter(|| bench_eq(&arr_a, &arr_b)));
+ c.bench_function("eq scalar Int32", |b| {
+ b.iter(|| {
+ eq_scalar(criterion::black_box(&arr_a), criterion::black_box(1)).unwrap()
+ })
+ });
+
+ c.bench_function("neq Int32", |b| b.iter(|| bench_neq(&arr_a, &arr_b)));
+ c.bench_function("neq scalar Int32", |b| {
+ b.iter(|| {
+ neq_scalar(criterion::black_box(&arr_a), criterion::black_box(1)).unwrap()
+ })
+ });
+
+ c.bench_function("lt Int32", |b| b.iter(|| bench_lt(&arr_a, &arr_b)));
+ c.bench_function("lt scalar Int32", |b| {
+ b.iter(|| {
+ lt_scalar(criterion::black_box(&arr_a), criterion::black_box(1)).unwrap()
+ })
+ });
+
+ c.bench_function("lt_eq Int32", |b| b.iter(|| bench_lt_eq(&arr_a, &arr_b)));
+ c.bench_function("lt_eq scalar Int32", |b| {
+ b.iter(|| {
+ lt_eq_scalar(criterion::black_box(&arr_a), criterion::black_box(1)).unwrap()
+ })
+ });
+
+ c.bench_function("gt Int32", |b| b.iter(|| bench_gt(&arr_a, &arr_b)));
+ c.bench_function("gt scalar Int32", |b| {
+ b.iter(|| {
+ gt_scalar(criterion::black_box(&arr_a), criterion::black_box(1)).unwrap()
+ })
+ });
+
+ c.bench_function("gt_eq Int32", |b| b.iter(|| bench_gt_eq(&arr_a, &arr_b)));
+ c.bench_function("gt_eq scalar Int32", |b| {
+ b.iter(|| {
+ gt_eq_scalar(criterion::black_box(&arr_a), criterion::black_box(1)).unwrap()
+ })
+ });
+
c.bench_function("eq MonthDayNano", |b| {
b.iter(|| bench_eq(&arr_month_day_nano_a, &arr_month_day_nano_b))
});