Subject: Re: kernel optimizations
To: Sung N. Cho <sucho2@vt.edu>
From: Matthias Buelow <mkb@mukappabeta.de>
List: netbsd-help
Date: 01/28/2002 19:31:04
Sung N. Cho writes:
>I have added the following optimizations in my mk.conf file. I am not sure
>if all these options are for optimizations since the man page for gcc was
>poor in describing these. If anyone sees that I've accidently put any
>deoptimizing options, your comment would be appreciated.
>
>
>CFLAGS+=-O3 -march=i386 -mcpu=i686
[...]
At least for the kernel, I'd leave "optimizations" as they are.
Using -O3 for everything is generally bad anyways, since it might
actually generate larger and slower code so it should only be used
selectively after careful profiling (as is the case with higher
optimization levels with any compiler.) Highest code improvement
options also have the tendency to move things around, eliminate or
expand lots of code, which might confuse interfacing with some
assembler parts or with device access code, so it's not too clever
anyways to apply these options. In the case of the kernel, even
if it produced something correct in the end, you very likely won't
notice any difference, since the kernel runs only in a fraction of
the time and then most processing is I/O bound (and the time-
consuming things are already quite optimized even for much slower
CPUs than your i686 already.)
--mkb