Missing and Unimplemented Features¶
This document attempts to capture features of the zstd C API that are currently not exposed to Python.
If there is a feature on this page that would be beneficial to you, please open a GitHub issue requesting its implementation. If an existing GitHub issue exists, please leave a comment on the issue to amplify the importance of the request (this project’s author doesn’t monitor the emoji counts).
Missing Constants¶
ZSTD_CLEVEL_DEFAULTZSTD_SRCSIZEHINT_MINZSTD_SRCSIZEHINT_MAXZSTD_BLOCKSIZE_MAX_MINZSTD_DECOMPRESSION_MARGIN
Compression and Decompression Parameters¶
ZSTD_p_forceAttachDictZSTD_dictForceLoadZSTD_c_targetCBlockSizeZSTD_c_literalCompressionModeZSTD_c_srcSizeHintZSTD_d_stableOutBufferZSTD_c_enableDedicatedDictSearchZSTD_c_stableInBufferZSTD_c_stableOutBufferZSTD_c_blockDelimitersZSTD_c_validateSequencesZSTD_c_useBlockSplitterZSTD_c_useRowMatchFinderZSTD_d_forceIgnoreChecksumZSTD_d_refMultipleDDictsZSTD_refMultipleDDicts_eZSTD_c_prefetchCDictTablesZSTD_c_enableSeqProducerFallbackZSTD_c_maxBlockSizeZSTD_c_searchForExternalRepcodesZSTD_d_disableHuffmanAssemblyZSTD_d_stableOutBuffer
Missing Functions¶
ZSTDMT_toFlushNow()ZSTD_minCLevel()ZSTD_cParam_getBounds()ZSTD_dParam_getBounds()ZSTD_generateSequences()ZSTD_mergeBlockDelimiters()ZSTD_compressSequences()ZSTD_writeSkippableFrame()ZSTD_decompressionMargin()ZSTD_sequenceBound()
Missing Features¶
ZSTD_getFrameProgression()isn’t exposed everywhere it could be.Compression parameters cannot be modified mid operation.
ZSTD_Sequenceand relatedZSTD_getSequences()not exposed.ZSTD_threadPoolnot exposed.ZSTD_sequenceProducer_FandZSTD_registerSequenceProducer()not exposed.ZSTD_CCtx_getParameter(),ZSTD_CCtxParam_getParameter(), andZSTD_DCtx_getParameter()could be leveraged for parameter retrieval.ZSTD_CCtx_setCParams()could potentially be utilized.ZSTD_error_*constants / error codes not exposed.
Potential 1.0 Release Features¶
The following track features and changes we would nominally perform before a 1.0 release.
Properly handle non-blocking I/O and partial writes for objects implementing
io.RawIOBase.Consider making reads across frames configurable behavior.
Overall API design review.
Use Python allocator where possible.
Figure out what to do about experimental APIs not implemented by CFFI.
APIs for auto adjusting compression parameters based on input size. e.g. clamping the window log so it isn’t too large for input.
Consider allowing compressor and decompressor instances to be thread safe, support concurrent operations. Or track when an operation is in progress and refuse to let concurrent operations use the same instance.
Support for magic-less frames for all decompression operations (
decompress()doesn’t work due to sniffing the content size and the lack of a ZSTD API to sniff magic-less frames - this should be fixed in 1.3.5.).Audit for complete flushing when ending compression streams.
Deprecate legacy APIs.
Audit for ability to control read/write sizes on all APIs.
Detect memory leaks via bench.py.
Remove low-level compression parameters from
ZstdCompressor.__init__and require use ofZstdCompressionParameters.Consider a
chunker()API for decompression.Consider stats for
chunker()API, including finding the last consumed offset of input data.Consider controls over resetting compression contexts (session only, parameters, or session and parameters).
Utilize
ZSTD_getDictID_fromCDict()?Stop relying on private libzstd headers and symbols (namely
pool.h).
And other non-essential features:
Support for block compression APIs.
API for ensuring max memory ceiling isn’t exceeded.
Move off nose for testing.