indygreg / indygreg/python-zstandard
Implement `max_length` argument on `ZstdDecompressionObj::decompress()`
Nobody has claimed this yet.
- Dominant language
- C
- Stars
- 642
- Forks
- 116
- Avg merge
- 1d 14h
- Merged PRs (30d)
- 5
Description
Python 3.6 added an optional max_length argument on decompressor's decompress() method. e.g. https://docs.python.org/3/library/zlib.html#zlib.Decompress.decompress.
This argument can reduce a lot of (but not all) of the performance badness in the API design of decompress() by allowing implementations to allocate a single output buffer of size max_length to avoid excessive memory allocations/copies.
We should support this optional argument.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start at the ZstdDecompressionObj::decompress() entry point and compare its current API with Python 3.6's zlib Decompress.decompress() documentation. Trace how output buffers are allocated, then define completion as accepting an optional max_length argument and limiting decompressed output accordingly.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- c, python
- Domain
- api
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100