Live data from Hacker News

A parallel implementation of gzip for modern multi-processor multi-core machines

github.com

51–60 of 70 posts

Re: A parallel implementation of gzip for modern multi-processor multi-core machines

#51
post #5

pigz is extremely fast and very capable, plus it's packed up and provided for almost every mainstream linux distribution, and can act as a drop in replacement for gzip as it supports the same flag syntax. On the bzip2 side there is pbzip2, which is also a drop in replacement, http://compression.ca/pbzip2/

There is also pixz for Xzip format. Which can be a godsend since xzip is such a slow compression. Just make sure you have the CPU to spare since it's a hog.

Re: A parallel implementation of gzip for modern multi-processor multi-core machines

#53
post #8
post #2

My guess is that this compresses less efficiently as you would have to shard the dictionaries. Might be close though for large files. I was surprised that there were no speed or efficiency comparisons in the README.

The max window size for zlib is 32 KB, so I don't think the default sharding at 128 KB would change much. You can pass the -b parameter if you find out a bigger shard works better on your data. If you are looking for details of the design of pigz, there is a very well-documented overview in the source of pigz.c: https://github.com/madler/pigz/blob/master/pigz.c#L187

had a quick scroll thru that source code - i didnt know you could implement a try/catch in C via macros...mind blown.

Re: A parallel implementation of gzip for modern multi-processor multi-core machines

#54

Probably useful for servers more than anything where perf really does matter at scale and content type is gzip.

Web servers have multiple connections so this isn't so applicable. Maybe special purpose ones zipping large datasets on the fly?

We combine both strategies for content: multicore native encoding + decoding :)

Re: A parallel implementation of gzip for modern multi-processor multi-core machines

#55
post #5

pigz is extremely fast and very capable, plus it's packed up and provided for almost every mainstream linux distribution, and can act as a drop in replacement for gzip as it supports the same flag syntax. On the bzip2 side there is pbzip2, which is also a drop in replacement, http://compression.ca/pbzip2/

There is also pixz for Xzip format. Which can be a godsend since xzip is such a slow compression. Just make sure you have the CPU to spare since it's a hog.

Xz does this natively now, with the -T parameter.

Re: A parallel implementation of gzip for modern multi-processor multi-core machines

#56
post #44
post #27

Earlier quoted context omitted.

pbzip2 only does parallel compression. lbzip2 can parallelize compression and decompression. With both pbzip2 and lbzip2 I got errors every now and then while everything worked with bzip2. YMMV. Also note that bzip2 is block based (due to bwt) and thus does not compromise compression ratios like parallelized gzip implantations. At 32 cores you can saturate Gbit links (even with good compression ratios!). I hope we wi…

Errors sound deeply concerning. What kind of errors? Is it too risky to use [pl]bzip2 for archival reasons?

Well, errors at a rate of one every few terabyte, and most of the time it was mainly decompression, and always caused program abort iirc.

But those have been a few years ago, so my best advice would be: retest.

You are testing your archives anyway, right? ;-)

Re: A parallel implementation of gzip for modern multi-processor multi-core machines

#57
post #53
post #8

Earlier quoted context omitted.

The max window size for zlib is 32 KB, so I don't think the default sharding at 128 KB would change much. You can pass the -b parameter if you find out a bigger shard works better on your data. If you are looking for details of the design of pigz, there is a very well-documented overview in the source of pigz.c: https://github.com/madler/pigz/blob/master/pigz.c#L187

had a quick scroll thru that source code - i didnt know you could implement a try/catch in C via macros...mind blown.

This book (C Interfaces and Implementations: Techniques for Creating Reusable Software) has a whole section on it:

https://www.amazon.com/Interfaces-Implementations-Techniques...

Re: A parallel implementation of gzip for modern multi-processor multi-core machines

#58
post #42

I love it! I just wish somebody can make a GPU based compression library (doesn't have to be gzip or bzip), every mobile device today is shipping with a GPU, there are some techniques out there like this ( http://on-demand.gputechconf.com/gtc/2014/presentations/S445... ), but I am still waiting for a solid implementation.

You may find work from my colleagues interesting: Parallel Lossless Data Compression on the GPU: http://www.idav.ucdavis.edu/publications/print_pub?pub_id=10... Fast Parallel Suffix Array on the GPU: http://escholarship.org/uc/item/83r7w305 I think built on top of the second paper (suffix array paper), there should be fast compression library. We have one implementation in our library CUDPP 2.0, you can try it out if you like: https://github.com/cudpp/cudpp/blob/master/src/cudpp/app/sa_...

Re: A parallel implementation of gzip for modern multi-processor multi-core machines

#60
post #56
post #44

Earlier quoted context omitted.

Errors sound deeply concerning. What kind of errors? Is it too risky to use [pl]bzip2 for archival reasons?

Well, errors at a rate of one every few terabyte, and most of the time it was mainly decompression, and always caused program abort iirc. But those have been a few years ago, so my best advice would be: retest. You are testing your archives anyway, right? ;-)

>You are testing your archives anyway, right? ;-)

Umm no, I handle errors which I expect to be reported to me.

Post reply on HN