Gzip better than Bz2 ? Normal?

Thomas Cameron thomas.cameron at camerontech.com
Mon Jan 2 03:06:34 UTC 2006


On Sun, 2006-01-01 at 19:38 -0500, Franck Y wrote:
> Hi everyone,
> I ve got a strange behavior with bz2 and gzip.
> When i compress a small folder around 225 Mo the compression goes to
>   49 Mo for gzip
> 46 mo for bzip2
> 
> When i compress a bigger folder around 5 Go the compression goes to
> 2.6 Go for gzip
> 3.1  mo for bzip2
> 
> 
> Bzip2 has a better compress for Small folder and gzip has a better one
> for big folder.
> Has anyone of you has the same effect.
> 
> Maybe gzip did'nt compress everything how can i check this.
> Should i be worried.
> It's mostly office document.
> Happy new year,

It is really dependent upon what it is you are compressing.  If you
compress a bunch of files like text files with a lot of "empty" space
inside them, you will get really good compression ratios.  If you
compress a bunch of files with compressed imaged (like PNG or JPG), then
you won't get very good compression at all.

On my system, I used gzip and bzip2 to compress /etc just as a test:

[root at ml110 ~]# tar zcf etc.tgz /etc/
tar: Removing leading `/' from member names
[root at ml110 ~]# tar jcf etc.tar.bz2 /etc/
tar: Removing leading `/' from member names
[root at ml110 ~]# ls -lh etc.t*
-rw-r--r--  1 root root 6.0M Jan  1 18:49 etc.tar.bz2
-rw-r--r--  1 root root 8.4M Jan  1 18:48 etc.tgz

So on my systems, bzip2 beat the heck out of gzip.

Thomas




More information about the fedora-list mailing list