I heard of pigz in the discussions following my interview of Yann Collet, creator of LZ4 and zstd. If you'll excuse the plug, here is the LZ4 story: Yann was bored and working as a project manager. So he started working on a game for his old HP 48 graphing calculator. Eventually, this hobby led him to revolutionize the field of data compression, releasing LZ4, ZStandard, and Finite State Entropy coders. His code ende…
Pigz: Parallel gzip for modern multi-processor, multi-core machines
191–197 of 197 posts
Re: Pigz: Parallel gzip for modern multi-processor, multi-core machines
#192John Carmack just had a tweet today on this problem: >I started a tar with bzip command on a big directory, and it has been running for two days. Of course, it is only using 1.07 cores out of the 128 available. The Unix pipeline tool philosophy often isn’t aligned with parallel performance. https://twitter.com/ID_AA_Carmack/status/1656708636570271768...
Is the .07 of a core a margin of error or some kind of status report done on a different core?
This is purely speculation though
Re: Pigz: Parallel gzip for modern multi-processor, multi-core machines
#193Re: Pigz: Parallel gzip for modern multi-processor, multi-core machines
#194Earlier quoted context omitted.
> What's well explored is compression rate not performance Exactly! And this seems like a shame to me with something burning so many cpu cycles. > true innovations, like arithmetic coding, are rare. Yeah, Yann tried to explain arithmetic coding to me, but I didn't get it.
I think arithmetic coding is much simpler than the way most resources describe it (the hard part is making it efficient). Consider this example: you want to transmit two completely random variables, both of which can have 5 states. The obvious way is to concatenate two bit fields of size ceil(log2(5)), so 3+3 = 6 bits. But alternatively, you can count the total number of states possible for both variables together, 5…
PPM-based [0] compression can work quite well for text but on its own it's not enough to unseat the Lempel-Ziv family as the top general purpose compressor.
[0] https://en.wikipedia.org/wiki/Prediction_by_partial_matching
Re: Pigz: Parallel gzip for modern multi-processor, multi-core machines
#195John Carmack just had a tweet today on this problem: >I started a tar with bzip command on a big directory, and it has been running for two days. Of course, it is only using 1.07 cores out of the 128 available. The Unix pipeline tool philosophy often isn’t aligned with parallel performance. https://twitter.com/ID_AA_Carmack/status/1656708636570271768...
With all respect to John Carmack (and it is really a lot of respect!) I'm surprised he seems unaware of pbzip2? It's a parallel implementation scales almost linearly with the amount of cores, and has been around since ~2010, so it's not yet old enough to drive, but anyone dealing with bzip2'ing large amounts of data should have discovered it long ago. And yes, use zstandard (or xz, where the default binary in your di…
... should really reconsider their choice of compression algorithm at this point.
Re: Pigz: Parallel gzip for modern multi-processor, multi-core machines
#196Earlier quoted context omitted.
But pigz shows that the unix pipeline philosophy works just fine. (of course compressing before tarring is probably better than compressing the tarred file, but that should be pipelinable as well)
Sometimes you need fast indexed access to a specific file in the compressed content without decompressing the entire file (let's say JARs, that are just ZIPs). TIL: you can use method 93 - Zstandard (zstd) Compression - with ZIPs
Re: Pigz: Parallel gzip for modern multi-processor, multi-core machines
#197Earlier quoted context omitted.
I think arithmetic coding is much simpler than the way most resources describe it (the hard part is making it efficient). Consider this example: you want to transmit two completely random variables, both of which can have 5 states. The obvious way is to concatenate two bit fields of size ceil(log2(5)), so 3+3 = 6 bits. But alternatively, you can count the total number of states possible for both variables together, 5…
> The coolest part IMO is how easy it is to plug in custom models for symbol probabilities. Usually a simple counter for each symbol is enough, but you can go crazy and start predicting the next symbol based on previous ones. PPM-based [0] compression can work quite well for text but on its own it's not enough to unseat the Lempel-Ziv family as the top general purpose compressor. [0] https://en.wikipedia.org/wiki/Pre…