This is the mail archive of the
libstdc++@gcc.gnu.org
mailing list for the libstdc++ project.
Re: The performance of <algorithm>.
- From: Gabriel Dos Reis <gdr at integrable-solutions dot net>
- To: <Richard dot Kreckel at ginac dot de>
- Cc: <libstdc++ at gcc dot gnu dot org>
- Date: 20 Nov 2003 01:49:46 +0100
- Subject: Re: The performance of <algorithm>.
- Organization: Integrable Solutions
- References: <Pine.LNX.4.33.0311192240260.29344-100000@higgs.physik.uni-mainz.de>
"Richard B. Kreckel" <kreckel@ginac.de> writes:
| Hi,
|
| 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?
We really really badly need to convince the compiler to support
language use patterns, not the other way around.
-- Gaby