Sunday, July 11, 2010

Performance of compress tools : 7z and gzip

hmc@hmc-desktop:/mnt/vm$ ls -l xp
total 5358756
-rw------- 1 hmc hmc 5481996800 2010-07-10 22:52 xp.vdi



compress this  5Gb file of virtual image, using 7z takes near 1 hours to finish, while gzip is about 8 minutes.  However, 7z's compress ratio is higher than gzip about 16%.

hmc@hmc-desktop:/mnt/vm$ time tar cvfz xp.gz ./xp
./xp/
./xp/xp.vdi

real    7m49.668s
user    6m3.430s
sys    0m28.660s


[compressed file size]

-rw-r--r-- 1 hmc  hmc  2587547513 2010-07-10 23:41 xp.7z
-rw-r--r-- 1 hmc  hmc  3332232784 2010-07-10 23:52 xp.gz


Here is a good article about compress tools' performance 

Compression Tools Compared

Add testing result with bz2.  Looks gz format will be my first choice.

hmc@hmc-desktop:/mnt/vm$ time tar cvfj xp.bz2 ./xp
./xp/
./xp/xp.vdi

real    36m11.689s
user    29m39.640s
sys    0m36.570s
hmc@hmc-desktop:/mnt/vm$ ls -l xp
total 5371056
-rw------- 1 hmc hmc 5494579712 2010-07-11 13:53 xp.vdi
hmc@hmc-desktop:/mnt/vm$ ls -l xp.bz2
-rw-r--r-- 1 hmc hmc 3318611695 2010-07-11 15:15 xp.bz2
 

No comments:

Post a Comment