Skip to 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:

Trackbacks

s9y testdrive on : gzip vs. pigz vs. bzip2 vs. pbzip2

Show preview
Shortly after the last benchmark, I came across pigz and a bigger (real-world) task to complete: $ time gzip -c file.tar > file.tar real 41m52.636s user 33m58.392s sys 2m26.903s $ time pigz -c file.tar > file.tar.pigz real 18m34.8

s9y testdrive on : Compression benchmarks

Show preview
Some time has passed since the last compression benchmarks and new contenders entered the race, so let's do another round of benchmarks, shall we? MacBook Pro 2013 $ tar -cf test.tar /usr/share/ $ ls -goh test.tar -rw-r--r-- 1 384M Oct 6 0

Comments

Display comments as Linear | Threaded

BerndH on :

Old Buddy gzip doesnt'look too bad. ;) Especially in comparison to bzip. :D

Add Comment

Form options

Submitted comments will be subject to moderation before being displayed.