comphead commented on code in PR #718:
URL: https://github.com/apache/datafusion-comet/pull/718#discussion_r1700720520
##########
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:
I would add some comments on magic numbers
--
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]