Re: Optimization levels when compiling PostgreSQL... - Mailing list pgsql-hackers

From Sean Chittenden
Subject Re: Optimization levels when compiling PostgreSQL...
Date
Msg-id 20020910030219.GU26147@ninja1.internal
Whole thread Raw
In response to Re: Optimization levels when compiling PostgreSQL...  (Bruce Momjian <pgman@candle.pha.pa.us>)
Responses Re: Optimization levels when compiling PostgreSQL...  (Bruce Momjian <pgman@candle.pha.pa.us>)
Re: Optimization levels when compiling PostgreSQL...  (Neil Conway <neilc@samurai.com>)
List pgsql-hackers
> > > The size difference between -O and -O3 is only 200K or so... does
> > > anyone think that it'd be safe to head to -O6 on a wide scale?
> > 
> > Dunno.  I'm not aware of any bits of the code that are unportable enough
> > to break with max optimization of any correct compiler.  But you might
> > find such a bug.  Or a bug in your compiler.  Are you feeling lucky
> > today?
> > 
> > My feeling is that gcc -O2 is quite well tested with the PG code.
> > I don't have any equivalent confidence in -O6.  Give it a shot for
> > beta-testing, for sure, but I'm iffy about calling that a
> > production-grade database release...
> 
> And of course the big question is whether you will see any performance
> improvement with -O6 vs. -O2.  My guess is no.

Agreed, however some of the loop-unrolling might prove to have some
optimization, but we'll see.  I'd like to think that there's some
actual value in -O6 beyond the geek appeal of being able to say it's
been compiled with all the optimizations possible.  ::shrug::

> > I'm thinking about changing this from a beta port to a -devel port
> > that I'll periodically update with snapshots.  I'll turn on -O6 for
> > the -devel port and -O2 for production for now.  If I don't hear of
> > any random bogons in the code I'll see if I can't increase it further
> > to -O3 and beyond at a slow/incremental rate.
> 
> Keep in mind that, while gcc is pretty stable for i386, the higher
> optimization levels (above -O2) do tend to have bogons on other
> processors, that vary with which version of gcc you're running.

Fully aware of these!!!  I've got a few systems running GCC 3.2 and
3.3 and it's touch and go above -O3, but most of these bogons are
mozilla and GUI related when it comes to complex thread handling.  For
more simple single threaded procs, the bugs get found out about pretty
quickly and end up making their way back into the GCC src tree.  I'm
thinking -O6 for the -devel port should work nicely as a way of
testing things out.  -sc

-- 
Sean Chittenden


pgsql-hackers by date:

Previous
From: Curt Sampson
Date:
Subject: Re: [JDBC] problem with new autocommit config parameter
Next
From: Bruce Momjian
Date:
Subject: Re: Optimization levels when compiling PostgreSQL...