wiki:CompressionSpeedTest

bzip2, gzip, or zip. Which will win the race?

File characteristic

quick# ls -alh embedded.img

-rw-r--r-- 1 root wheel 1.0G Nov 4 16:55 embedded.img

quick# mdconfig -a -t vnode -f embedded.img

md0

quick# mount /dev/md0

md0% md0s1% md0s1a%

quick# mount /dev/md0s1a /mnt/ quick# df -h | grep mnt

/dev/md0s1a 961M 189M 695M 21% /mnt

Experiments

quick# time zip embedded.img.zip embedded.img

adding: embedded.img

31.350u 0.706s 0:32.23 99.4% 223+1310k 4+604io 0pf+0w

quick# time gzip embedded.img

36.136u 0.781s 0:37.13 99.4% 42+1491k 2+604io 0pf+0w

quick# time bzip2 embedded.img

91.701u 0.961s 1:32.83 99.8% 37+1496k 1+533io 0pf+0w

quick# ls -lah embedded.img.*

-rw-r--r-- 1 root wheel 67M Nov 4 16:55 embedded.img.bz2 -rw-r--r-- 1 root wheel 75M Nov 4 16:55 embedded.img.gz -rw-r--r-- 1 root wheel 76M Nov 4 16:58 embedded.img.zip

quick# time unzip embedded.img.zip

Archive: embedded.img.zip

inflating: embedded.img

8.175u 1.237s 0:18.30 51.3% 145+1354k 0+8000io 0pf+0w

quick# time gunzip embedded.img.gz

6.076u 1.380s 0:17.98 41.4% 42+1500k 0+8000io 0pf+0w

quick# time bunzip2 embedded.img.bz2

20.996u 1.935s 0:31.99 71.6% 37+1487k 0+8000io 0pf+0w

Results

Use bzip2 for best compression, but trade off is time (roughly 2x more), still do-able though. Also do mind that zip is the only one support by Windows(r) by default. Others require programs like 7-Zip to be installed. Secondly zip is not installed on the system by default, use: quick# pkg_add -r zip unzip

Last modified 15 years ago Last modified on Nov 4, 2009, 6:07:47 PM
Note: See TracWiki for help on using the wiki.