WordPress / WordPress/wordpress-playground

[Data Liberation] Re-entrant gzip decoder

Open
#2,002 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

[Aspect] Data Liberation [Type] Enhancement
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:

  1. 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.
  2. 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

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.