mightsleep commented on code in PR #11527:
URL: https://github.com/apache/arrow-rs/pull/11527#discussion_r4348096309
##########
arrow/benches/merge_kernels.rs:
##########
@@ -146,11 +168,39 @@ fn mask_cases(len: usize) -> Vec<(&'static str,
BooleanArray)> {
]
}
-fn bench_merge_on_input_generator(c: &mut Criterion, input_generator: &impl
InputGenerator) {
+fn run_mask_cases(len: usize) -> Vec<(&'static str, BooleanArray)> {
+ [
+ ("runs_of_64_50pct_true", 0.5, 64.0),
+ ("runs_of_64_10pct_true", 0.1, 64.0),
+ ("runs_of_512_50pct_true", 0.5, 512.0),
+ ("runs_of_512_10pct_true", 0.1, 512.0),
+ ]
+ .into_iter()
+ .map(|(name, density, run)| (name, create_clustered_array(len, density,
run, 7)))
+ .collect()
+}
+
+/// Which input combinations to run for a type.
+#[derive(PartialEq)]
+enum Scenarios {
+ All,
+ /// Only an array against a scalar, the CASE WHEN ... THEN expr ELSE
literal shape.
+ ScalarSide,
+}
+
+fn bench_merge_on_input_generator(
+ c: &mut Criterion,
+ input_generator: &impl InputGenerator,
+ scenarios: Scenarios,
+) {
const ARRAY_LEN: usize = 8192;
let mut group =
c.benchmark_group(format!("merge_{ARRAY_LEN}_from_{}",
input_generator.name()).as_str());
+ // One merge of 8192 rows takes microseconds, so the default 3 s warm up
Review Comment:
Yes hello, agreed. Cut it down the same way as #10919: one strings (3..20)
type instead of short/long strings and bytes, dropped
non_null_scalar_vs_null_scalar, and kept two of the four run masks (runs of 64
at 50 %, runs of 512 at 10 %). 448 -> 168 cases, under the 240 on main. I kept
8192 rows: at smaller batches the fixed per-call cost starts to dominate and
the per-row difference this suite is meant to show gets harder to see.
--
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]