Date: Wed, 9 Aug 2006 17:53:01 -0500 From: Brooks Davis <brooks@one-eyed-alien.net> To: Nikolas Britton <nikolas.britton@gmail.com> Cc: Matthias Andree <matthias.andree@gmx.de>, freebsd-stable@freebsd.org Subject: Re: gzip is faster with -O3 Message-ID: <20060809225301.GA11962@lor.one-eyed-alien.net> In-Reply-To: <ef10de9a0608091531n7d605bb5s49e266b13da6b855@mail.gmail.com> References: <ef10de9a0608090649k78d87350v638b2d3f1432e735@mail.gmail.com> <m3ejvqat8n.fsf@merlin.emma.line.org> <ef10de9a0608091531n7d605bb5s49e266b13da6b855@mail.gmail.com>
next in thread | previous in thread | raw e-mail | index | archive | help
--u3/rZRmxL6MmkK24 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, Aug 09, 2006 at 05:31:58PM -0500, Nikolas Britton wrote: > On 8/9/06, Matthias Andree <matthias.andree@gmx.de> wrote: > > > >1. gzip isn't usually used to compress incompressible data. > > > >2. use "time" to figure out how much CPU time it actually burns. > > 5 GB are somewhat I/O bound, but gcc options don't help with that, so > > CPU time is better than wallclock time. > > >=20 > dd if=3D/dev/zero of=3Dtestfile bs=3D1m count=3D5000 >=20 > gzip comiled with -O3 > # time nice -10 ./gzip -c9 testfile > /dev/null > 73.187u 8.682s 2:08.41 63.7% 70+617k 40161+0io 0pf+0w >=20 > gzip compiled with -O2 > # time nice -10 ./gzip -c9 testfile > /dev/null > 61.183u 8.468s 2:00.14 57.9% 58+609k 40162+0io 0pf+0w >=20 > Now... what do all of those numbers mean, I've never used time > before... thanks for the tip btw? In this case the used a similar amount of system time (the number ending in s), but the -O3 case took 8 seconds more user time (the number ending in u) and real time (the third number.) If this were statisticaly meaningful, -O3 would be slower in this case. If you want to do a meaningful test you need to do several runs each way, probably ignoring the first one due to cache effects and then run the results through the program you can build in src/tools/tools/ministat/ so see if there is a measurable difference. Poul-Henning Kamp has a nice (if probably somewhat overkill for this case) writeup on doing benchmarking here: http://lists.freebsd.org/pipermail/freebsd-current/2004-January/019595.html It's a tricky business even for something simple. :) You might also consider using /usr/bin/time instead of the csh builtin time. It's output is a little more readable. -- Brooks --u3/rZRmxL6MmkK24 Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.2 (FreeBSD) iD8DBQFE2mdNXY6L6fI4GtQRAvaiAJ0QsPFFakVS21ARszAxtnq322o/4wCfd8b1 9wJSqDOskKATJ1j3r0np/Y0= =Ow2+ -----END PGP SIGNATURE----- --u3/rZRmxL6MmkK24--
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20060809225301.GA11962>