Skip to main content

gzip vs. bzip2 vs. pbzip2 vs. xz vs. lzma

Yes, another benchmark. And yes, YMMV - big time:

$ ls -lh file.tar
-rw-r--r-- 1 bob bob 80M May 27 12:36 file.tar

$ compress-test.sh file.tar
### gzip/9c:    6 seconds / 48.700% smaller
### bzip2/9c:   44 seconds / 50.300% smaller
### pbzip2/9c:  22 seconds / 50.200% smaller
### xz/9c:      79 seconds / 53.400% smaller
### lzma/9c:    120 seconds / 53.200% smaller
### gzip/1c:    4 seconds / 46.200% smaller
### bzip2/1c:   30 seconds / 48.100% smaller
### pbzip2/1c:  15 seconds / 48.000% smaller
### xz/1c:      35 seconds / 51.100% smaller
### lzma/1c:    18 seconds / 49.700% smaller
### gzip/dc:    0 seconds
### bzip2/dc:   7 seconds
### pbzip2/dc:  4 seconds
### xz/dc:      4 seconds
### lzma/dc:    5 seconds
Versions used: