lakshaydevoo-arch commented on code in PR #27008:
URL: https://github.com/apache/datafusion/pull/27008#discussion_r4452186905


##########
datafusion/common/benches/with_hashes.rs:
##########
@@ -645,10 +670,33 @@ fn mixed_columns_benchmark(c: &mut Criterion) {
     });
 }
 
+/// Int32 dictionaries with 50% and 97% null keys. 0% and 3% are covered by
+/// the existing `dictionary_utf8_int32` "no nulls" and "nulls" cases in
+/// `criterion_benchmark`
+fn dictionary_benchmark(c: &mut Criterion) {
+    let pool = StringPool::new(100, 64);
+    let dict = pool.typed_dictionary_array::<Int32Type>(BATCH_SIZE);
+    let name = "dictionary_utf8_int32";
+    for null_percent in [50, 97] {
+        let array = with_null_keys(&dict, null_percent as f32 / 100.0);
+        c.bench_function(&format!("{name}: single, {null_percent}% null 
keys"), |b| {
+            do_hash_test(b, std::slice::from_ref(&array));
+        });
+        c.bench_function(
+            &format!("{name}: multiple, {null_percent}% null keys"),
+            |b| {
+                let arrays = vec![array.clone(), array.clone(), array.clone()];
+                do_hash_test(b, &arrays);
+            },
+        );
+    }
+}

Review Comment:
   Updated. I've moved the 50% and 97% null-key cases into the existing 
`criterion_benchmark()` loop and removed the separate benchmark function, the 
existing benchmark cases remain unchanged.



-- 
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]

Reply via email to