kazuyukitanimura commented on code in PR #718:
URL: https://github.com/apache/datafusion-comet/pull/718#discussion_r1700802799


##########
native/core/benches/bit_util.rs:
##########
@@ -159,6 +160,38 @@ fn criterion_benchmark(c: &mut Criterion) {
         );
     }
 
+    // trailing_bits
+    for length in (0..=64).step_by(32) {
+        let x = length;
+        group.bench_with_input(
+            BenchmarkId::new("trailing_bits", format!("num_bits_{}", x)),
+            &x,
+            |b, &x| {
+                b.iter(|| trailing_bits(black_box(1234567890), black_box(x)));
+            },
+        );
+    }
+
+    // read_u64
+    group.bench_function("read_u64", |b| {
+        b.iter(|| read_u64(black_box(&[0u8; 8])));
+    });
+
+    // read_u32
+    group.bench_function("read_u32", |b| {
+        b.iter(|| read_u32(black_box(&[0u8; 4])));
+    });
+
+    // get_u32_value
+    group.bench_function("get_u32_value", |b| {
+        b.iter(|| {
+            let mut reader: BitReader = BitReader::new_all(buffer.slice(0));
+            for _ in 0..(buffer.len() * 8 / 31) {

Review Comment:
   This is no a magic number, I just chose this randomly, no specific reasons



-- 
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: github-unsubscr...@datafusion.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: github-unsubscr...@datafusion.apache.org
For additional commands, e-mail: github-h...@datafusion.apache.org

Reply via email to