Crates.io | floatpack |
lib.rs | floatpack |
version | 0.1.0 |
source | src |
created_at | 2021-11-12 16:15:18.615595 |
updated_at | 2021-11-12 16:15:18.615595 |
description | Bitpacking with SIMD for `Decimal` from the `rust_decimal` crate |
homepage | |
repository | |
max_upload_size | |
id | 480980 |
size | 8,893 |
Bitpacking with SIMD for Decimal
from the rust_decimal
crate.
The algorithm:
Decimal
value is serialized into its components (= 4 x u32
)The idea is that this should get good compression rates with little computational complexity, especially for contiguous data. In timeseries data, usually:
This represents a highly specific use-case. If you are not dealing with timeseries data other compression algorithms are probably more suitable.
use floatpack::{pack, unpack};
use rust_decimal_macros::*;
let values = vec![dec!(1.0), dec!(2.0), dec!(3.0)];
assert_eq!(values, unpack(&pack(&values[..])));