On Wed, Aug 09, 2006 at 05:31:58PM -0500, Nikolas Britton wrote: > On 8/9/06, Matthias Andree <[EMAIL PROTECTED]> 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. > > > > dd if=/dev/zero of=testfile bs=1m count=5000 > > 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 > > 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 > > 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
pgp820W2lpVvK.pgp
Description: PGP signature