Hi,

> On 23 Dec 2017, at 11:12 pm, Joshua Root <[email protected]> wrote:
> 
>> On 2017-12-24 08:40 , Eitan Adler wrote:
>> In macports base in standard_configure.sh
>> 
>> there is this line:
>>  6 env PATH=/usr/bin:/bin:/usr/sbin:/sbin CFLAGS="-pipe -Os"
>> ./configure --enable-readline
>> 
>> Why do we compile with -Os instead of -O2?
>> 
>> As far as I could the only difference, in llvm 4.0.1, is to disable
>> the "libcalls-shrinkwrap" opt pass.
> 
> It's what Apple uses, so presumably better tested. IIRC they found it
> tends to perform a little better than -O2.

In general its not possible to say one setting will always perform better than 
another,  its very use case dependant. For instance if you really want maximum 
numerical performance then -O3 can give significant gains, as it turns on a 
number of optimisations that can really help, like auto vectorisation. But, you 
would not want that as the default as some use cases might not like it. Its 
fine to have a default, but i would suggest each port should use whatever 
upstream has decided is its best optimisation level.

> 
> - Josh

Reply via email to