I'm comparing compression functions, and I'm surprised by what I'm seing. Maybe I'm doing something wrong, but everything I've tested has been more compressed by gzip than bzip2!

I was under the impression that bzip2 was better than gzip. Can someone give an example of data that would demonstrate this? Thanks.

link|improve this question

feedback

2 Answers

up vote 3 down vote accepted

gzip is stream-oriented, bzip2 is block-oriented. You will need several tens of kilobytes before you see an advantage with bzip2.

link|improve this answer
Additionally, there's also "pbzip2" (the "p" is for "parallel") which takes advantage of multiple processors (by using "pthreads") for additional performance gains: compression.ca/pbzip2 – Randolf Richardson May 10 '11 at 6:40
feedback

One example of many - the Linux kernel 2.6.11.0 source tarball. See http://tukaani.org/lzma/benchmarks.html for more.

link|improve this answer
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.