Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 26 Feb 2008 09:32:16 +0000
From:      Alex Zbyslaw <xfb52@dial.pipex.com>
To:        Tim Kientzle <kientzle@freebsd.org>
Cc:        freebsd-hackers@freebsd.org
Subject:   Re: emulate an end-of-media
Message-ID:  <47C3DCA0.5000205@dial.pipex.com>
In-Reply-To: <47C3A228.7090703@freebsd.org>
References:  <op.t63j2veq724k7f@martin>	<20080225154455.4822e72a@bhuda.mired.org>	<47C33384.6040701@dial.pipex.com> <200802252243.m1PMhTeq016201@fire.js.berklix.net> <47C3A228.7090703@freebsd.org>

next in thread | previous in thread | raw e-mail | index | archive | help
Tim Kientzle wrote:

>> Why compress?  It's ancient technology and will be vastly outperformed 
>
>
> Yes, gzip or bzip2 compress better, but they also:
>  * Are a lot slower.
>  * Use a lot more data memory.
>  * Require a lot more code.

I don't understand what "a lot more code" has to do with anything.  
gzip/zlib is part of base and portable.

In my quick tests on some real dump files, *if* you are able to specify 
the compression quality, then gzip -1 is both faster and better 
compressing than compress.  If I'm reading time correctly, then gzip at 
any compression level used less memory than compress.  bzip2 uses more 
memory but -9 always uses roughly the same amount of memory: ~9Mb. 

180672 -r--r-----   1 root  alex  - 184893440 Feb 26 09:08 
cartman-root.dump.0

131 {root @ ren} # time compress cartman-root.dump.0
7.948u 0.264s 0:08.93 91.8%     15+744k 0+725io 0pf+0w
 92896 -r--r-----   1 root  alex  - 95051115 Feb 26 09:08 
cartman-root.dump.0.Z

134 {root @ ren} # time gzip -1 cartman-root.dump.0
6.543u 0.288s 0:06.93 98.4%     56+585k 1+549io 2pf+0w
 70368 -r--r-----   1 root  alex  - 71979780 Feb 26 09:08 
cartman-root.dump.0.gz

137 {root @ ren} # time gzip -9 cartman-root.dump.0
44.588u 0.304s 0:46.53 96.4%    56+584k 0+494io 0pf+0w
 63344 -r--r-----   1 root  alex  - 64800326 Feb 26 09:08 
cartman-root.dump.0.gz

140 {root @ ren} # time bzip2 cartman-root.dump.0
51.327u 0.398s 0:53.44 96.7%    30+9638k 3+471io 3pf+0w
 60384 -r--r-----   1 root  alex  - 61769750 Feb 26 09:08 
cartman-root.dump.0.bz2

And for a largely text filesystem dump:

 58352 -r--r-----   1 root  alex  - 59699200 Feb 26 09:13 cartman-var.dump.0

152 {root @ ren} # time compress cartman-var.dump.0
2.179u 0.102s 0:02.31 98.2%     15+737k 0+156io 1pf+0w
20000 -r--r-----   1 root  alex  - 20456769 Feb 26 09:13 
cartman-var.dump.0.Z

155 {root @ ren} # time gzip -1 cartman-var.dump.0
1.441u 0.069s 0:01.53 98.0%     57+592k 0+116io 0pf+0w
14992 -r--r-----   1 root  alex  - 15328819 Feb 26 09:13 
cartman-var.dump.0.gz

158 {root @ ren} # time gzip -9 cartman-var.dump.0
4.807u 0.062s 0:04.89 99.3%     56+583k 0+104io 0pf+0w
13424 -r--r-----   1 root  alex  - 13727598 Feb 26 09:13 
cartman-var.dump.0.gz

161 {root @ ren} # time bzip2 cartman-var.dump.0
28.057u 0.132s 0:28.97 97.2%    30+9629k 0+91io 0pf+0w
11792 -r--r-----   1 root  alex  - 12052157 Feb 26 09:13 
cartman-var.dump.0.bz2


--Alex




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?47C3DCA0.5000205>