Th

Thread-Parallel Decompression and Random Access to Gzip Files (Pragzip)

Hacker News

Thread-Parallel Decompression and Random Access to Gzip Files (Pragzip)

Hello HN, I'm very excited to have finished a gzip decoder that can speed up decompression using threads. On my Ryzen 3900X, I measured a 8x speedup over standard gzip, reaching 1.6 GB/s for a synthetic file with a consistent compression ratio of 1.3. A functional decompressor like this is kind of a first, that's why I am excited. Pragzip implements the two-staged decompression idea put forward with pugz, which unfortunately only works with gzipped text files not arbitrary files and has many more limitations. I think my main contribution over pugz might be a fast (~10 MB/s) data-agnostic deflate block finder, which might btw also be used to rescue corrupted gzip files). Note that pigz does compress files in parallel but it effectively is not able to decompress not even their own produced files in parallel. You can try out pragzip via PyPI or by building the C++ pragzip tool from source: python3 -m pip install --user pragzip pragzip --version # 0.2.0 Here is a quick comparison with a very Huffman-intensive workload tested on a 12-core Ryzen 3900X: base64 /dev/urandom | head -c $(( 4 * 1024 * 1024 * 1024 )) > 4GiB gzip 4GiB # compresses to a 3.1 GiB large file called 4GiB.gz time gzip -d -c 4GiB.gz | wc -c # real ~21.6 s (~200 MB/s) time pigz -d -c 4GiB.gz | wc -c # real ~12.9 s (~332 MB/s) time pragzip -P 0 -d -c 4GiB.gz | wc -c # real ~2.7 s (~1.6 GB/s decompression bandwidth) I have unit tests for files produced with gzip, bgzip, igzip, pigz, Python's gzip, and python-pgzip. It should therefore work for any "normal" gzip file and is feature-complete but needs a lot of testing and polishing. Note that it is very memory-intensive depending on the archive's compression factor and of course the number of cores being used. This will be subject to further improvements. Bug reports, feature requests, or anything else are very welcome!

Share card

Actual performance

15points
3comments
Made the leaderboard

Launch Intel predictions

Analyze your own launch →
Indie HackersFits the IH revenue-focused audience · Strong signals: para · Missing: supports, reddit linkedin, podcasting
84%84% predicted probability of success on Indie Hackers, based on ML models trained on real launch data.
best fitHighest predicted score across all platforms for this description.
Product HuntOn track for Day 1 leaderboard · Strong signals: user, using, code · Missing: mac, agents, macos
68%68% predicted probability of success on Product Hunt, based on ML models trained on real launch data.
Hacker NewsStrong engagement from HN community · Strong signals: excited, ide, io · Missing: https docs, just released, exist
57%57% predicted probability of success on Hacker News, based on ML models trained on real launch data.
nativeThis product was originally launched on this platform.
AppSumoMay struggle as an AppSumo deal · Missing: plus, platform, intuitive
31%31% predicted probability of success on AppSumo, based on ML models trained on real launch data.
TrustMRRLess likely to generate early MRR · Strong signals: para · Missing: mobile apps, ios, personal
28%28% predicted probability of success on TrustMRR, based on ML models trained on real launch data.
Acquire.comPre-revenue stage for this audience · Missing: arr, mrr, revenue
16%16% predicted probability of success on Acquire.com, based on ML models trained on real launch data.
BetaListMay not resonate with beta-testers · Missing: web3, chat, crypto
0%0% predicted probability of success on BetaList, based on ML models trained on real launch data.

Correct prediction on native model

Similar products

Pa
Parallelized random access to bzip2 files from Python written in C++46%Launch Intel prediction score: how likely this product is to succeed on its source platform, based on its name, tagline, and description.

Parallelized random access to bzip2 files from Python written in C++

Hacker News2
A
A Parallel Implementation of Graph2Vec45%Launch Intel prediction score: how likely this product is to succeed on its source platform, based on its name, tagline, and description.

A Parallel Implementation of Graph2Vec

Hacker News53
A
A Parallel Implementation of Graph2Vec45%Launch Intel prediction score: how likely this product is to succeed on its source platform, based on its name, tagline, and description.

A Parallel Implementation of Graph2Vec

Hacker News3
Pa
Parallel Gospel48%Launch Intel prediction score: how likely this product is to succeed on its source platform, based on its name, tagline, and description.

Parallel Gospel

Hacker News1
So
Sorts – parallel radix- and quicksort in Go48%Launch Intel prediction score: how likely this product is to succeed on its source platform, based on its name, tagline, and description.

Sorts – parallel radix- and quicksort in Go

Hacker News2
Ra
Random resource26%Launch Intel prediction score: how likely this product is to succeed on its source platform, based on its name, tagline, and description.

Random resource

Hacker News2
Ra
Random pythagoras trees55%Launch Intel prediction score: how likely this product is to succeed on its source platform, based on its name, tagline, and description.

Random pythagoras trees

Hacker News1
Pr
Programmer Excuses, random excuses from a programmer49%Launch Intel prediction score: how likely this product is to succeed on its source platform, based on its name, tagline, and description.

Programmer Excuses, random excuses from a programmer

Hacker News5
Ra
Random Airports37%Launch Intel prediction score: how likely this product is to succeed on its source platform, based on its name, tagline, and description.

Random Airports

Hacker News3
Ra
Random Periscope Streams48%Launch Intel prediction score: how likely this product is to succeed on its source platform, based on its name, tagline, and description.

Random Periscope Streams

Hacker News2