Skip to content

Commit

Permalink
Move bitpacking generic
Browse files Browse the repository at this point in the history
  • Loading branch information
gatesn committed Jun 15, 2024
1 parent f935871 commit 3ae3942
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions benches/bitpacking.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ fn bitpacking(c: &mut Criterion) {
let mut packed = vec![0; 128 * WIDTH / size_of::<u16>()];

b.iter(|| {
BitPacking::bitpack::<WIDTH>(
BitPacking::<WIDTH>::bitpack(
array_ref![values, 0, 1024],
array_mut_ref![packed, 0, 192],
);
Expand All @@ -27,7 +27,7 @@ fn bitpacking(c: &mut Criterion) {
const WIDTH: usize = 3;
let values = [3u16; 1024];
let mut packed = [0; 128 * WIDTH / size_of::<u16>()];
b.iter(|| BitPacking::bitpack::<WIDTH>(&values, &mut packed));
b.iter(|| BitPacking::<WIDTH>::bitpack(&values, &mut packed));
});
}

Expand All @@ -37,10 +37,10 @@ fn bitpacking(c: &mut Criterion) {
const WIDTH: usize = 3;
let values = [3u16; 1024];
let mut packed = [0; 128 * WIDTH / size_of::<u16>()];
BitPacking::bitpack::<WIDTH>(&values, &mut packed);
BitPacking::<WIDTH>::bitpack(&values, &mut packed);

let mut unpacked = [0u16; 1024];
b.iter(|| BitPacking::bitunpack::<WIDTH>(&packed, &mut unpacked));
b.iter(|| BitPacking::<WIDTH>::bitunpack(&packed, &mut unpacked));
});
}

Expand All @@ -50,11 +50,11 @@ fn bitpacking(c: &mut Criterion) {
const WIDTH: usize = 3;
let values = [3u16; 1024];
let mut packed = [0; 128 * WIDTH / size_of::<u16>()];
BitPacking::bitpack::<WIDTH>(&values, &mut packed);
BitPacking::<WIDTH>::bitpack(&values, &mut packed);

b.iter(|| {
for i in 0..1024 {
black_box::<u16>(BitPacking::bitunpack_single::<WIDTH>(&packed, i));
black_box::<u16>(BitPacking::<WIDTH>::bitunpack_single(&packed, i));
}
});
});
Expand Down

0 comments on commit 3ae3942

Please sign in to comment.