by tman · 16y ago · 0 comments
Here are some comparisons between the big 3 compression algorithms (taken from http://blogs.reucon.com/srt/tags/compression/ -- he used a 163 MB Mysql dump file for the tests):
Compressor Size Ratio Compression Decompression
gzip 89 MB 54 % 0m 13s 0m 05s
bzip2 81 MB 49 % 1m 30s 0m 20s
7-zip 61 MB 37 % 1m 48s 0m 11s Compressor Size Ratio Compression Decompression
gzip -9 555M 59% 2m39.840s 0m16.495s
bzip2 -9 531M 56% 4m10.541s 1m27.720s
xz -9 457M 48% 13m55.730s 0m53.290sBandwidth is cheap. Stick to gzip.
Bandwidth is cheap. Stick to gzip.
It's not as simple as that. Which one is better depends on the use case. If you're sending a one-off file to somebody, sure, gzip is better. But if you want to distribute a file to a large number of people (like Linux distributions do with their packages), the extra CPU time is insignificant compared to the bandwidth saved over the course of thousands of downloads.