Skip to content

Commit

Permalink
Shorter bytecode by leveraging repeatitive patterns
Browse files Browse the repository at this point in the history
  • Loading branch information
fulmicoton committed Jul 22, 2022
1 parent f9a9f71 commit 89b8b71
Show file tree
Hide file tree
Showing 6 changed files with 149 additions and 128 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ description = "Fast integer compression/decompression via SIMD bit-packing. Port
edition = "2018"

[dependencies]
crunchy = "0.2"
unroll = "0.1"

[dev-dependencies]
rand = "0.8"
Expand Down
2 changes: 1 addition & 1 deletion src/bitpacker1x.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ mod scalar {

type DataType = u32;

fn set1(el: i32) -> DataType {
const fn set1(el: i32) -> DataType {
el as u32
}

Expand Down
2 changes: 1 addition & 1 deletion src/bitpacker4x.rs
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ mod scalar {

type DataType = [u32; 4];

fn set1(el: i32) -> DataType {
const fn set1(el: i32) -> DataType {
[el as u32; 4]
}

Expand Down
2 changes: 1 addition & 1 deletion src/bitpacker8x.rs
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ mod scalar {

type DataType = [u32; 8];

fn set1(el: i32) -> DataType {
const fn set1(el: i32) -> DataType {
[el as u32; 8]
}

Expand Down
2 changes: 1 addition & 1 deletion src/bitpacking_bench.rs
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ fn criterion_benchmark_bitpacker<TBitPacker: BitPacker + 'static>(
bitpacker: TBitPacker,
criterion: &mut Criterion,
) {
for &num_bit in [1u8, 15u8, 31u8].iter() {
for &num_bit in [1u8, 24u8, 31u8].iter() {
let num_bits = [num_bit; NUM_BLOCKS];
criterion.bench(
name,
Expand Down
Loading

0 comments on commit 89b8b71

Please sign in to comment.