This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: std::pow implementation


Richard Earnshaw wrote:
Profiling doesn't help if the answer comes back as "sometimes"
(function foo's use of bar is best inlined, function wibble's use of
bar is best not inlined).

Inlining is an optimization; in all but the most obvious and trivial
cases (e.g., simple assignments), it should be performed by a programmer *after* profiling, and not before. "Premature optimization is the root of all evil", according to Hoare and Knuth; in code reviews, I tend to grumble about people who insist on inlining and using cute tricks, when they haven't done any analysis as to how their choices affect code quality and performance.


The programmer, not the compiler, has the responsibility to create an effective program.

--
Scott Robert Ladd
Coyote Gulch Productions (http://www.coyotegulch.com)
Software Invention for High-Performance Computing


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]