Re:File Compression in the Multi-Core Era
by DarkShikari on Sunday March 01, 2009 @07:00AM
(#498928)
Bzip2 is a very slow compression algorithm, mostly due, from what I recall, to the Burrows-Wheeler transform that lies at its core. LZMA is pretty much superior in every respect; it is (though quite slowly) on the road to replacing the aging Bzip2.
And as usual the comments on CodingHorror (at least the initial dozen or two) show a relative ignorance about the topic. 7zip (as can any compressor) can be trivially parallelized just by running it simultaneously on each solid block. The compression cost of a smaller solid block size is generally near-zero for the case where dictionary size << input data size.
The included Windows interface doesn't allow this kind of threading AFAIK, but it would be relatively simple to implement in an app using the LZMA libraries.
This is the exact approach taken by pigz (Parallel GZIP) - http://www.zlib.net/pigz/
> and uses the zlib and pthread libraries
Er, no, thanks. What about a good STL C++ implementation with OpenMP (automagic on STL.)
That's great for us, developers. We'll never run out of things to do :)
So it looks like 7zip is not just slightly better than bzip; it's much better. Ideally you can utilize all your cores by piping data from the DB directly into the compressor -- the compressor will use 2 cores (or whatever), and your database will use the rest.