Re: gcc: why optimize for size flag is not the default

From: Marko Kreen <markokr(at)gmail(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Heikki Linnakangas <heikki(dot)linnakangas(at)enterprisedb(dot)com>, Nikhil Sontakke <nikhil(dot)sontakke(at)enterprisedb(dot)com>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: gcc: why optimize for size flag is not the default
Date: 2009-03-11 13:51:26
Message-ID: e51f66da0903110651o5502ee38p910be2a5e8fe8388@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 3/11/09, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
> Heikki Linnakangas <heikki(dot)linnakangas(at)enterprisedb(dot)com> writes:
> > Nikhil Sontakke wrote:
> >> I was wondering why -Os is not used in place of -O2 while compiling the
> >> Postgres sources with gcc.
>
>
> > There's no free lunch.
>
>
> In any case, this sort of choice is generally something that ought to be
> applied at a distro level. If, say, Fedora or Debian chose to use -Os
> uniformly across all their packages, then there might be a meaningful
> amount of space saved in the aggregate. As far as I know, though, -Os
> is not the preferred choice in any distro, which ought to tell you
> something ...

Linux kernel is moving to use -Os everywhere. AFAIK their argument is
that kernel code should not be doing anything CPU-intensive, thus
minimal cache usage is more important than unrolled loops.

This also seems to hint that -Os is not really appropriate to Postgres.
Although it would be good fit for eg. PgBouncer.

--
marko

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Alvaro Herrera 2009-03-11 13:54:13 Re: Updates of SE-PostgreSQL 8.4devel patches (r1710)
Previous Message Greg Stark 2009-03-11 13:29:43 Re: Has anybody think about changing BLCKSZ to an option of initdb?