pub struct ZSTD_dictAttachPref_e(/* private fields */);Expand description
Note: this enum and the behavior it controls are effectively internal implementation details of the compressor. They are expected to continue to evolve and should be considered only in the context of extremely advanced performance tuning.
Zstd currently supports the use of a ZSTD_CDict in three ways:
-
The contents of the
CDictcan be copied into the working context. This means that the compression can search both the dictionary and input while operating on a single set of internal tables. This makes the compression faster per byte of input. However, the initial copy of theCDict’s tables incurs a fixed cost at the beginning of the compression. For small compressions (< 8 KB), that copy can dominate the cost of the compression. -
The
CDict’s tables can be used in-place. In this model, compression is slower per input byte, because the compressor has to search two sets of tables. However, this model incurs no start-up cost (as long as the working context’s tables can be reused). For small inputs, this can be faster than copying theCDict’s tables. -
The
CDict’s tables are not used at all, and instead we use the working context alone to reload the dictionary and use params based on the source size. SeeZSTD_compress_insertDictionaryandZSTD_compress_usingDict. This method is effective when the dictionary sizes are very small relative to the input size, and the input size is fairly large to begin with.
Zstd has a simple internal heuristic that selects which strategy to use at the beginning of a compression. However, if experimentation shows that Zstd is making poor choices, it is possible to override that choice with this enum.
Implementations§
Source§impl ZSTD_dictAttachPref_e
impl ZSTD_dictAttachPref_e
Sourcepub const ZSTD_dictDefaultAttach: Self
pub const ZSTD_dictDefaultAttach: Self
Use the default heuristic
Sourcepub const ZSTD_dictForceAttach: Self
pub const ZSTD_dictForceAttach: Self
Never copy the dictionary
Sourcepub const ZSTD_dictForceCopy: Self
pub const ZSTD_dictForceCopy: Self
Always copy the dictionary
Sourcepub const ZSTD_dictForceLoad: Self
pub const ZSTD_dictForceLoad: Self
Always reload the dictionary
Trait Implementations§
Source§impl Clone for ZSTD_dictAttachPref_e
impl Clone for ZSTD_dictAttachPref_e
Source§fn clone(&self) -> ZSTD_dictAttachPref_e
fn clone(&self) -> ZSTD_dictAttachPref_e
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more