News for hackers. Stuff that matters.
Re:File Compression in the Multi-Core Era by jrockway on Sunday March 01, 2009 @04:50AM (#498880)
This is interesting, but not for the reasons Jeff suggests. bzip uses all 8 cores for 21 minutes to produce a 986M file (or 2 minutes for 1092M), while 7zip doesn't use all 8 cores, and produces a file smaller than anything bzip can produce, in 5 minutes.

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.

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.

Re:File Compression in the Multi-Core Era by Andys on Sunday March 01, 2009 @07:52AM (#498950)
This is the exact approach taken by pigz (Parallel GZIP) - http://www.zlib.net/pigz/
Re:File Compression in the Multi-Core Era by alecco on Sunday March 01, 2009 @09:39AM (#498997)
> 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 :)

Re:File Compression in the Multi-Core Era by Andys on Monday March 02, 2009 @07:31PM (#500856)
Whats the problem? pigz works as advertised for me. Almost a 4x speed increase on a 4 core system, assuming your storage I/O can keep up.