Re: gcc: why optimize for size flag is not the default - Mailing list pgsql-hackers

From Heikki Linnakangas
Subject Re: gcc: why optimize for size flag is not the default
Date
Msg-id 49B77643.9060400@enterprisedb.com
Whole thread Raw
In response to gcc: why optimize for size flag is not the default  (Nikhil Sontakke <nikhil.sontakke@enterprisedb.com>)
Responses Re: gcc: why optimize for size flag is not the default  (Tom Lane <tgl@sss.pgh.pa.us>)
List 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


pgsql-hackers by date:

Previous
From: Nikhil Sontakke
Date:
Subject: gcc: why optimize for size flag is not the default
Next
From: Simon Riggs
Date:
Subject: Re: Prepping to break every past release...