time test
Greg Louis
glouis at dynamicro.on.ca
Sun Nov 24 13:42:19 CET 2002
On 20021123 (Sat) at 1807:40 -0500, David Relson wrote:
> For laughs, I built bogofilter with four different optimization
> levels. The compiler switches used were '-G' (no optimization), '-O1,
> '-O2', and '-O3'. bogofilter was run 1000 times on a test message.
>
> g O1 O2 O3
> user 18.17 15.69 15.05 14.89
> system 3.24 3.40 3.17 3.11
> elapsed 21.44 19.32 18.23 18.00
>
> It appears that maximum speed is about 1/7 (14%) better than worst code.
>
> Notes: tests run on 500 mhz Pentium III with 256mb ram, kernel
> linux-2.4.19-16mdk.
On reading the above, I decided "just for kicks" to try my
0.8.0-derived production version with -O3. Variation from run to run
of the "time" command is about 2% so it's hard to be sure, but any two
adjacent runs (alternating between -O2 and -O3) show the -O3 version
(./bogofilter) being about 35-50 microseconds (~1%) faster:
# time for i in `seq 1 2000`; do bogofilter </root/testmsg; done
real 0m15.290s user 0m10.650s sys 0m4.610s
# time for i in `seq 1 2000`; do ./bogofilter </root/testmsg; done
real 0m15.218s user 0m10.590s sys 0m4.600s
That's on a 1.1 GHz (500 millihertz is a bit slow, no? :) PIII/mobile with
512Mb RAM / kernel 2.4.20-rc2-ac3.
--
| G r e g L o u i s | gpg public key: |
| http://www.bgl.nu/~glouis | finger greg at bgl.nu |
More information about the Bogofilter
mailing list