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

From: Heikki Linnakangas <heikki(dot)linnakangas(at)enterprisedb(dot)com>
To: Nikhil Sontakke <nikhil(dot)sontakke(at)enterprisedb(dot)com>
Cc: PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: gcc: why optimize for size flag is not the default
Date: 2009-03-11 08:28:51
Message-ID: 49B77643.9060400@enterprisedb.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Nikhil Sontakke wrote:
> I was wondering why -Os is not used in place of -O2 while compiling the
> Postgres sources with gcc. I prepared 2 install directories by respectively
> using -Os and -O2 flags and in the former case it seems to reduce the
> install footprint by about 1MB or so. Agreed this is not significant for
> normal systems. But I was wondering if there is a performance reason too for
> not using -Os.

-Os disables optimizations that make the code run faster, like loop
unrolling. There's no free lunch.

--
Heikki Linnakangas
EnterpriseDB http://www.enterprisedb.com

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Simon Riggs 2009-03-11 08:41:28 Re: Prepping to break every past release...
Previous Message Nikhil Sontakke 2009-03-11 08:14:12 gcc: why optimize for size flag is not the default