Dandandan commented on a change in pull request #9454:
URL: https://github.com/apache/arrow/pull/9454#discussion_r574796751
##########
File path: rust/arrow/benches/arithmetic_kernels.rs
##########
@@ -58,13 +58,19 @@ fn bench_divide(arr_a: &ArrayRef, arr_b: &ArrayRef) {
criterion::black_box(divide(&arr_a, &arr_b).unwrap());
}
+fn bench_divide_scalar(array: &ArrayRef, divisor: f32) {
+ let array = array.as_any().downcast_ref::<Float32Array>().unwrap();
+ criterion::black_box(divide_scalar(&array, divisor).unwrap());
+}
+
fn bench_limit(arr_a: &ArrayRef, max: usize) {
criterion::black_box(limit(arr_a, max));
}
fn add_benchmark(c: &mut Criterion) {
let arr_a = create_array(512, false);
let arr_b = create_array(512, false);
+ let scalar = 1.12358;
Review comment:
Can we generate a random scalar (with seed) at runtime?
This to avoid optimizing more than most scenario's when the scalar is a
variable.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]