Struct q_compress::CompressorConfig
source · [−]Expand description
All the settings you can specify about compression.
Some, like delta_encoding_order
, are explicitly stored as Flags
in the
compressed bytes.
Others, like compression_level
, affect compression but are not explicitly
stored in the output.
Fields
compression_level: usize
compression_level
ranges from 0 to 12 inclusive, defaulting to 6.
The compressor uses up to 2^compression_level
prefixes.
For example,
- Level 0 achieves a modest amount of compression with 1 prefix and can be twice as fast as level 6.
- Level 6 achieves nearly the best compression with 64 prefixes and still runs in reasonable time. In some cases, its compression ratio is 3-4x as high as level level 0’s.
- Level 12 can achieve a few % better compression than 6 with 4096 prefixes but runs ~10x slower in many cases.
delta_encoding_order: usize
delta_encoding_order
ranges from 0 to 7 inclusive, defaulting to 0.
It is the number of times to apply delta encoding
before compressing. For instance, say we have the numbers
[0, 2, 2, 4, 4, 6, 6]
and consider different delta encoding orders.
- 0 indicates no delta encoding, it compresses numbers as-is. This is perfect for columnar data were the order is essentially random.
- 1st order delta encoding takes consecutive differences, leaving
[0, 2, 0, 2, 0, 2, 0]
. This is perfect for continuous but noisy time series data, like stock prices. - 2nd order delta encoding takes consecutive differences again,
leaving
[2, -2, 2, -2, 2, -2]
. This is perfect for locally linear data, like a sequence of timestamps sampled approximately periodically. - Higher-order delta encoding is good for time series that are very smooth, like temperature or light sensor readings.
Trait Implementations
sourceimpl Clone for CompressorConfig
impl Clone for CompressorConfig
sourcefn clone(&self) -> CompressorConfig
fn clone(&self) -> CompressorConfig
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
sourceimpl Debug for CompressorConfig
impl Debug for CompressorConfig
sourceimpl Default for CompressorConfig
impl Default for CompressorConfig
sourceimpl From<&'_ CompressorConfig> for Flags
impl From<&'_ CompressorConfig> for Flags
sourcefn from(config: &CompressorConfig) -> Self
fn from(config: &CompressorConfig) -> Self
Converts to this type from the input type.
Auto Trait Implementations
impl RefUnwindSafe for CompressorConfig
impl Send for CompressorConfig
impl Sync for CompressorConfig
impl Unpin for CompressorConfig
impl UnwindSafe for CompressorConfig
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcefn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more