Re: Optimization levels when compiling PostgreSQL...

From: Sean Chittenden <sean(at)chittenden(dot)org>
To: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>, Curt Sampson <cjs(at)cynic(dot)net>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: Optimization levels when compiling PostgreSQL...
Date: 2002-09-10 03:02:19
Message-ID: 20020910030219.GU26147@ninja1.internal
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Bruce Momjian 2002-09-10 03:04:58 Re: Optimization levels when compiling PostgreSQL...
Previous Message Curt Sampson 2002-09-10 02:59:55 Re: [JDBC] problem with new autocommit config parameter