Ubuntu – Should I use xz or lzma compression

compression

I was wondering since in Ubuntu 10.10 I have the ability to create both xz and lzma archives. Should I switch to xz?

http://en.wikipedia.org/wiki/Xz

http://en.wikipedia.org/wiki/Lzma

Best Answer

This benchmark provides some good information about this issue. It seems that LZMA has slightly better compression ratios and performance than XZ but XZ is generally preferred due to 'practical reasons' (I'm not sure what these are).

XZ is an implementation of the lzma2 algorithm and is better at compressing 'uncompressable' data:

lzma2 is the method of compression employed by the 7-Zip LZMA2 compressor. LZMA2 is a modified version of LZMA that offers a better compression ratio for uncompressible data (random data expands about 0.005%, compared to 1.35% with original LZMA), and optionally can compress multiple parts of large files in parallel, greatly increasing compression speed but with a possible reduction in compression ratio (see LZMANumBlockThreads). Like LZMA, it can consume a lot of memory; see the above table. If a compression level isn't specified, it defaults to max.

(http://www.jrsoftware.org/ishelp/index.php?topic=setup_compression)

You should be OK using either.