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


> 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.


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