WordPress / WordPress/wordpress-playground
[Data Liberation] Re-entrant gzip decoder
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 2k
- Forks
- 462
- Avg merge
- 18h 44m
- Merged PRs (30d)
- 33
Description
Let's build a custom GZip decoder to explore re-entrant decompression.
There are two ways to do re-entrant stream decoding of large zip files:
- Seek to the relevant file and decode the gzipped data until a specific offset is reached. For remote files, this requires downloading potentially hundreds of gigabytes of data.
- Seek to the last decoded gzip block and start directly there. This has very little overhead.
PHP has build-in functions for working with gzip compression, but they don't expose the internal decoder state such as the last block start or the current Huffman code dictionary. However, the decompression can only continue from an arbitrary offset if we have that state. The first decompression method listed above simply recomputes it. The second method saves that work by restoring the state directly.
Therefore, to support resuming zip / gzip processing, we need a custom-built GZip decoder capable of exposing and restoring its internal state.
A part of #1894
Contributor guide
No contributing guide indexed for this repository
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
Review the two resumption approaches described in the issue and the related work in #1894. The work is done when a custom GZip decoder can expose and restore the internal state needed to resume processing from an arbitrary offset.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- php
- Domain
- backend
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 20/100