std::pow implementation
Robert Dewar
dewar@gnat.com
Wed Jul 30 14:05:00 GMT 2003
> He can profile.
Profiling is of limited use here. It may find hotspots, but the issue of
how to treat large numbers of small functions that should be inlined cannot
be addressed by profiling, since you may have situations where you have many
such functions and no one function shows up as a hot spot. For an example
look at the set of pragma Inlines for the Ada units sinfo.ads and einfo.ads.
Basically in Ada, we regard pragma Inline as meaning: this function is pretty
small and I call it quite often and I would like the calls to be efficient.
Feel free to optimize in a way that improves time performance even if more
space is generated. I am guessing that it would make sense to inline calls
(I know the standard doesn't formally define this, but you know what I mean).
What we do in practice is to mark the function as inlinable, and use a higher
than usual threshhold for deciding to inline it, which seems to work pretty
well.
More information about the Gcc
mailing list