in...">

Linux compression shootout

I decided to run some tests to see which compression methods are the most effective and most efficient. I tested the 4 main utilities that I know of (info-zip, gzip, bzip, and compress)

I've included my results below, but I will give you some of my feelings as well. Basically it appears that tar + gzip is the fastest/most effective for everyday use. Seperating the commands (tar and then a seperate gzip/bzip) doesn't add any extra compression. Bzip is a very effective compression method, but it's also considerably slower. Info-zip doesn't compress very well, and it's only moderately speedy. However info-zip is very cross platform compatible, while the others are not.

Apache (11243520 bytes - 972 files)
-----------------------------------

info zip:
real    0m4.140s
2883675 bytes apache.zip
zip -9r apache.zip apache_1.3.23/*

tar + gzip:
real    0m2.876s
2223231 bytes apache.tar.gz
tar cfvpz apache.tar.gz apache_1.3.23

tar and seperate gzip:
tar took: real    0m0.261s
gzip took: real    0m2.462s
2223242 bytes apache.tar.gz
tar cfvp apache.tar apache_1.3.23/ && gzip apache.tar

tar + bzip:
real    0m11.456s
1760375 bytes apache.tar.bz
tar cfvpj apache.tar.bz apache_1.3.23

tar then bzip:
tar: real    0m0.261s
bzip2: real    0m11.235s
1760375 bytes apache.tar.bz2
tar cfvp apachec.tar apache_1.3.23/ && bzip2 apache.tar

tar then compress:
tar: real    0m0.261s
compress: real    0m2.550s
3531552 bytes apache.tar.Z
tar cfvp apache.tar apache_1.3.23/ && compress apache.tar

MP3 (3229988 bytes - 1 file)
----------------------------

info zip:
real    0m1.540s
3156391 bytes quite_bitter_beings.zip
zip -9v quite_bitter_beings.zip quite_bitter_beings.mp3

tar + gzip:
real    0m1.373s
3156430 bytes quite_bitter_beings.tar.gz
tar cfvpz quite_bitter_beings.tar.gz quite_bitter_beings.mp3

tar then gzip:
tar: real    0m0.048s
gzip: real    0m1.405s
3156454 bytes quite_bitter_beings.tar.gz
tar cfvp quite_bitter_beings.tar quite_bitter_beings.mp3 && gzip quite_bitter_beings.tar

tar + bzip:
real    0m6.680s
3139187 bytes quite_bitter_beings.tar.bz
tar cfvpj quite_bitter_beings.tar.bz quite_bitter_beings.mp3
tar cfvp quite_bitter_beings.tar quite_bitter_beings.mp3 && time bzip2 quite_bitter_beings.tar

tar then bzip:
tar: real    0m0.048s
bzip2: real    0m6.624s
3139187 bytes quite_bitter_beings.tar.bz2
tar cfvp quite_bitter_beings.tar quite_bitter_beings.mp3 && bzip2 quite_bitter_beings.tar

tar then compress:
tar: real    0m0.261s
compress: real    0m1.298s
Isn't working!!!
tar cfvp quite_bitter_beings.tar quite_bitter_beings.mp3 && compress quite_bitter_beings.tar
Leave A Reply - 1 Reply
Replies
Jim Hopkin 2007-05-30 07:35am - No Email - Logged IP: 195.93.21.103

separate se (apart) + pareo ( to place )

All content licensed under the Creative Commons License