neilconway commented on code in PR #20385:
URL: https://github.com/apache/datafusion/pull/20385#discussion_r2827545939
##########
datafusion/functions-nested/benches/array_has.rs:
##########
@@ -265,48 +539,81 @@ fn bench_array_has_all_strings(c: &mut Criterion) {
group.finish();
}
-fn bench_array_has_any_strings(c: &mut Criterion) {
- let mut group = c.benchmark_group("array_has_any_strings");
-
- let portfolio_size = 100;
- let check_sizes = vec![1, 3, 5, 10];
-
- for &check_size in &check_sizes {
+/// Benchmarks array_has_any with one scalar arg. Varies the scalar argument
+/// size while keeping the columnar array small (3 elements per row).
+fn bench_array_has_any_scalar(c: &mut Criterion) {
+ let mut group = c.benchmark_group("array_has_any_scalar");
+ let config_options = Arc::new(ConfigOptions::default());
+ let return_field: Arc<Field> = Field::new("result", DataType::Boolean,
true).into();
+
+ let array_size = 3;
+ let scalar_sizes = vec![1, 10, 100, 1000];
+
+ // i64 benchmarks
+ let first_arr_i64 = create_int64_list_array(NUM_ROWS, array_size,
NULL_DENSITY);
+ let list_type_i64 = first_arr_i64.data_type().clone();
+ let arg_fields_i64: Vec<Arc<Field>> = vec![
+ Field::new("first", list_type_i64.clone(), false).into(),
+ Field::new("second", list_type_i64.clone(), false).into(),
+ ];
+
+ for &scalar_size in &scalar_sizes {
+ let scalar_arg = create_int64_scalar_list(scalar_size, 0);
Review Comment:
Good catch! Thank you.
--
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.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]