Function zstd_sys::ZDICT_trainFromBuffer_fastCover
source · pub unsafe extern "C" fn ZDICT_trainFromBuffer_fastCover(
dictBuffer: *mut c_void,
dictBufferCapacity: usize,
samplesBuffer: *const c_void,
samplesSizes: *const usize,
nbSamples: c_uint,
parameters: ZDICT_fastCover_params_t
) -> usize
Expand description
ZDICT_trainFromBuffer_fastCover():
Train a dictionary from an array of samples using a modified version of COVER algorithm.
Samples must be stored concatenated in a single flat buffer samplesBuffer
,
supplied with an array of sizes samplesSizes
, providing the size of each sample, in order.
d and k are required.
All other parameters are optional, will use default values if not provided
The resulting dictionary will be saved into dictBuffer
.
@return: size of dictionary stored into dictBuffer
(<= dictBufferCapacity
)
or an error code, which can be tested with ZDICT_isError().
See ZDICT_trainFromBuffer() for details on failure modes.
Note: ZDICT_trainFromBuffer_fastCover() requires 6 * 2^f bytes of memory.
Tips: In general, a reasonable dictionary has a size of ~ 100 KB.
It’s possible to select smaller or larger size, just by specifying dictBufferCapacity
.
In general, it’s recommended to provide a few thousands samples, though this can vary a lot.
It’s recommended that total size of all samples be about ~x100 times the target size of dictionary.