LZMA
From openSUSE
The Lempel-Ziv-Markov chain-Algorithm (LZMA) is an algorithm for data compression in development since 1998 and used in the 7z format of the 7-Zip archiver. It uses a dictionary compression scheme somewhat similar to LZ77 and features a high compression ratio (generally higher than bzip2) and a variable compression-dictionary size.
For openSUSE 11.0, openSUSE switched away from bzip2 to LZMA for the RPM payload.
Contents |
Comparisons to Bzip2
Some figures of comparison are available from Stephan Kulow's blog post. The test features firstly some comparisons of compression (with coreutils as an example):
bzip2
-rw-r--r-- 1 coolo suse 36966400 13. Mär 09:42 coreutils-6.10.tar 8.61user 0.05system 0:08.66elapsed 99%CPU (0avgtext+0avgdata 0maxresident)k 0inputs+11936outputs (0major+2007minor)pagefaults 0swaps -rw-r--r-- 1 coolo suse 6110179 13. Mär 09:45 coreutils-6.10.tar.bz2.9
LZMA
5.83user 0.04system 0:05.88elapsed 100%CPU (0avgtext+0avgdata 0maxresident)k 0inputs+10720outputs (0major+3271minor)pagefaults 0swaps -rw-r--r-- 1 coolo suse 5488129 13. Mär 09:48 coreutils-6.10.tar.lzma.2
Or:
42.07user 0.10system 0:42.27elapsed 99%CPU (0avgtext+0avgdata 0maxresident)k 0inputs+8576outputs (0major+6768minor)pagefaults 0swaps -rw-r--r-- 1 coolo suse 4385224 13. Mär 09:50 coreutils-6.10.tar.lzma.5
As you can easily see, lzma -2 beats bzip2 -9 both at size and compression speed (using slightly more memory).
Above that it's no longer win-win as you win another 1MB if you go with -5 at the cost of taking 5x the compression time bzip2 needs and twice as memory.
Decompression
LZMA also offers significant benefits for decompression speeds:
bzip2
uncompressing the bzip.9: 1.81user 0.00system 0:01.82elapsed 100%CPU (0avgtext+0avgdata 0maxresident)k 0inputs+0outputs (0major+1068minor)pagefaults 0swaps
LZMA
Uncompressing the lzma.2:
0.80user 0.00system 0:00.83elapsed 97%CPU (0avgtext+0avgdata 0maxresident)k 0inputs+0outputs (0major+824minor)pagefaults 0swaps
That's 2.3 times faster than bzip2.
Uncompressing the lzma.5:
0.69user 0.01system 0:00.70elapsed 99%CPU (0avgtext+0avgdata 0maxresident)k 0inputs+0outputs (0major+1080minor)pagefaults 0swaps
2.6 times faster.
Conclusion
LZMA provides significant benefits over bzip2 for users:
- Smaller downloads (higher compression)
- Faster Installation of packages (faster decompression)
For distributions:
- More space for software on physical media (installation CD/DVD/USBs)
- Less bandwidth usage (because of smaller packages)

