asubiotto commented on code in PR #12070:
URL: https://github.com/apache/arrow-rs/pull/12070#discussion_r4467069953


##########
arrow-ipc/benches/ipc_reader.rs:
##########
@@ -185,6 +188,47 @@ fn criterion_benchmark(c: &mut Criterion) {
             }
         })
     });
+
+    for (name, nested) in [("flat", false), ("nested", true)] {
+        let buffer = wide_dictionary_ipc_stream(1000, nested);
+        group.bench_function(format!("StreamReader/dictionaries_1000/{name}"), 
|b| {
+            b.iter(|| {
+                let mut reader = StreamReader::try_new(buffer.as_slice(), 
None).unwrap();
+                reader.next().unwrap().unwrap();
+                assert!(reader.next().is_none());
+            })
+        });
+    }
+}
+
+/// Return an IPC stream with one small record batch of `num_columns` 
dictionary columns, so the
+/// stream holds `num_columns` dictionary batches. With `nested`, each 
dictionary is a list item.
+fn wide_dictionary_ipc_stream(num_columns: usize, nested: bool) -> Vec<u8> {
+    let dictionary: ArrayRef = Arc::new(

Review Comment:
   Yes, in general this benchmark should be useful to any perf improvement to 
reading IPC dictionaries. Changed to run with 4 and 4k values.



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

Reply via email to