alamb commented on code in PR #8988:
URL: https://github.com/apache/arrow-rs/pull/8988#discussion_r2620600128
##########
arrow/benches/zip_kernels.rs:
##########
@@ -224,6 +223,74 @@ fn bench_zip_input_on_all_masks(
}
}
+fn bench_zip_on_string_view_scalar(c: &mut Criterion, input_generator:
&GenerateStringView) {
+ bench_zip_on_string_view_scalars(c, input_generator, input_generator);
+}
+
+fn bench_zip_on_string_view_scalars(
+ c: &mut Criterion,
+ input_generator_1: &GenerateStringView,
+ input_generator_2: &GenerateStringView,
+) {
+ let mut group = c.benchmark_group(
+ format!(
+ "zip_{ARRAY_LEN}_from_{} and {}",
+ input_generator_1.name(),
+ input_generator_2.name()
+ )
+ .as_str(),
+ );
+
+ let null_scalar = input_generator_1.generate_null();
+
+ let non_null_scalar_1 = input_generator_1.generate();
Review Comment:
Sorry -- I still don't get this benchmark -- calling
`input_generator_1.generate()` results in a array (not a scalar):
```rust
impl GenerateStringView {
fn name(&self) -> &str {
self.description.as_str()
}
fn generate_null(&self) -> ArrayRef {
new_null_array(&DataType::Utf8View, 1)
}
fn generate(&self) -> ArrayRef {
Arc::new(create_string_view_array_with_fixed_len(
1,
0.0,
self.str_len,
))
}
}
```
I would have expected a test something like
```rust
let null_scalar = input_generator.generate_null_scalar();
let non_null_scalar = input_generator.generate_scalar(); // make a 1 row
array
let array = input_generator.generate_array(); // make a 8192 array
...
And then you could run the combinations
```
(array, non_null_scalar),
(non_null_scalar, array),
(array, null_scalar),
(null_scalar, array)
```
--
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]