This is the mail archive of the libstdc++@gcc.gnu.org mailing list for the libstdc++ 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: The performance of <algorithm>.


On 20 Nov 2003, Gabriel Dos Reis wrote:
> | Well, I never bought the "An Inline Function is As Fast As a Macro" rumor.
> | But still, an experiment using std::for_each shows rather disturbing
> | results.  Given
> |     struct A { virtual void someaction(); };
> | can anybody give an easy explanation why
> |     for_each(av.begin(), av.end(), mem_fun(&A::something));
> | blows up the size of the compiled code by a factor of two compared to the
> | straightforward implemenation?  (Even when one hacks for_each to be
> | inlined?  (BTW, why isn't it inlined?))
>
> Do you mean that when you declare std::for_each as an inline function?

Yes, that's what i meant.
(I was *not* talking about inline limits kicking in or such.)

> We really really badly need to convince the compiler to support
> language use patterns, not the other way around.

Could you elaborate a bit, please?

Regards
    -richy.
-- 
Richard B. Kreckel
<Richard.Kreckel@GiNaC.DE>
<http://www.ginac.de/~kreckel/>


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