Subject: Re: kernel optimizations
To: Matthias Buelow <mkb@mukappabeta.de>
From: Sung N. Cho <sucho2@vt.edu>
List: netbsd-help
Date: 01/28/2002 14:46:52
Oh, boy! Who would have thought simple optimizations would improve so much
speed! Maybe it's my opinion, but before I've accidently had "-g" option
which generated kernel size of 14Megs, kdemedia player would be choppy
everytime I open something while it's playing. Now I recompiled the kernel
without "-g" option and kdemedia player runs very smooth, not a glitch I hear
even when opening other programs while it's playing.
It seems that NetBSD 1.52 kernel gets compiled without error under both "-O2"
or "-O3" settings. And, both "-O2" and "-O3" creates kernel of same size.
But, I have to admit, my kdemedia player works just as fine under "-O2" or
"-O3". But, definitely having "-g" makes noticeable performance degrade
from kdemedia player (hears short interrupts when opening files!) and my
kernel was huge, 14Meg!"
Thumbs up:
CFLAGS+=-O2 -march=i386 -mcpu=i686
CXXFLAGS=-O2 -march=i386 -mcpu=i686
COPTS+=-O2 -mcpu=i686 -fexpensive-optimizations -ffast-math -msoft-float \
-fmemoize-lookups -fthread-jumps -m486 -fomit-frame-pointer \
-finline-functions
Thumbs up:
CFLAGS+=-O3 -march=i386 -mcpu=i686
CXXFLAGS=-O3 -march=i386 -mcpu=i686
COPTS+=-O3 -mcpu=i686 -fexpensive-optimizations -ffast-math -msoft-float \
-fmemoize-lookups -fthread-jumps -m486 -fomit-frame-pointer \
-finline-functions
Thumbs down:
CFLAGS+=-O3 -march=i386 -mcpu=i686
CXXFLAGS=-O3 -march=i386 -mcpu=i686
COPTS+=-g -O3 -mcpu=i686 -fexpensive-optimizations -ffast-math -msoft-float \
-fmemoize-lookups -fthread-jumps -m486 -fomit-frame-pointer \
-finline-functions
Infact, I've noticed that having "-g" option disables the optimizations as
Steven Grunza pointed out earlier. And, there's no noticeable performance
difference between "-O2" and "-O3". Both are fast, but I suppose "-O2" would
be on the safer measure for most purposes as Matthias Buelow pointed out
previously.
Thanks for all your info.
Yours sincerely,
Sung N. Cho,
Monday, Jan. 28, 2002.
On Monday 28 January 2002 07:21 pm, Matthias Buelow wrote:
> Sung N. Cho writes:
> >Here's my new, modified mk.conf:
> >CFLAGS+=-O2 -march=i386 -mcpu=i686
> >CXXFLAGS=-O2 -march=i386 -mcpu=i686
> >COPTS+=-O2 -mcpu=i686 -fexpensive-optimizations -ffast-math -msoft-float \
> > -fmemoize-lookups -fthread-jumps -m486 -fomit-frame-pointer \
> > -finline-functions
>
> I personally would leave the optimizations at -O2, which does about
> all of the above except inline-functions (which might be one of the
> things which could cause problems, or bloat the code). Dunno about
> the soft-float thing or how architecture-specific options weigh in.
> -m486 or possibly -m686 should be relatively safe but don't quote me
> on that. In any case, trust me on that that you wouldn't notice
> any difference in system performance. You're free to experiment and
> share your results with the mailing list, however :)
>
> --mkb