Re:Happy new year and goodbye bzip2
by pedrocr on Friday December 27, 2013 @09:17PM
(#6973560)
Your link shows bzip2 having a more balanced compression time than lzma that is often 3-4 times slower. So for a tarball xz sounds indeed better as you compress once and uncompress many times. For compressing HTTP or things of the sort bzip2 might be better, but maybe for those cases gzip is already best.
[ Parent
| on HN ]
You are right, I was speaking to the compression ratios and decompression times. For cases where something is compressed once and decompressed many times I don't care much how long it takes to do the initial compression (within reason, of course).
Here is another with lz4, lzo as well as lzma1, although they're not very relevant for the tarball test. Gzip -9 is on par with bzip2 -1 while almost twice as fast. And uses practically no memory(!).
http://pokecraft.first-world.info/wiki/Quick_Benchmark:_Gzip...
-1 is an edge-case: if you're memory constrained, bzip2 isn't a good fit. Otherwise, you pay the extremely low percentage increase in CPU time to use -9 where bz2 will massively outperform gzip on most workloads.
Note that LZMA decompressed at 20MB/s in that benchmark, while bzip2 managed about 6.
LZMA tends to be faster and more efficient than bzip2 in all respects.