Optimzed vs. readable code

Pierre THIERRY nowhere.man@levallois.eu.org
Tue Nov 29 22:31:00 GMT 2005


Le Tue, 29 Nov 2005 10:45:19 -0800, Howard Hinnant a écrit :
> You are the victim of unfortunate timing. :-)  I just posted in
> another thread:
>> That philosophy is basically:  Keep things as simple as possible.
>> Don't gratuitously add code just to see if the compiler can  optimize
>> it back out.

I agree with that. The thing is, in CS courses on compilation, one can
learn that it is nowadays a so classic optimization that one can safely
expect it from any decent compiler.

> And while you are  probably correct that an optimizer will result in
> identical object  code for changes like this, such a change is adding
> to the complexity  of the overall product (library + compiler).

The question could be: do you know any compiler yet, used widely enough
that it is important for libstdc++ to actively support it, that won't do
that tiny optimization?

If not, I couldn't see any other argument against that change, and there
are arguments in favor of it...

Curiously,
Nowhere man
-- 
nowhere.man@levallois.eu.org
OpenPGP 0xD9D50D8A




More information about the Libstdc++ mailing list