Skip to content
This repository has been archived by the owner on Feb 18, 2024. It is now read-only.

Commit

Permalink
add zero_count benchmark
Browse files Browse the repository at this point in the history
  • Loading branch information
ritchie46 committed Sep 26, 2021
1 parent 57c455a commit 2a6093d
Showing 1 changed file with 27 additions and 0 deletions.
27 changes: 27 additions & 0 deletions benches/bitmap_ops.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,33 @@ fn add_benchmark(c: &mut Criterion) {
assert!(r.null_count() > 0);
})
});

let offset = ((size as f64) * 0.1) as usize;
let len = ((size as f64) * 0.85) as usize;

c.bench_function(
&format!("bitmap count zeros 85% slice 2^{}", log2_size),
|b| {
b.iter(|| {
let r = bitmap.clone().slice(offset, len);
assert!(r.null_count() > 0);
})
},
);

let offset = ((size as f64) * 0.2) as usize;
let len = ((size as f64) * 0.51) as usize;

c.bench_function(
&format!("bitmap count zeros 51% slice 2^{}", log2_size),
|b| {
b.iter(|| {
let r = bitmap.clone().slice(offset, len);
assert!(r.null_count() > 0);
})
},
);

let bitmap1 = bitmap.clone().slice(1, size - 1);
c.bench_function(&format!("bitmap not 2^{}", log2_size), |b| {
b.iter(|| {
Expand Down

0 comments on commit 2a6093d

Please sign in to comment.