|
Boost : |
From: Pavel Vozenilek (pavel_vozenilek_at_[hidden])
Date: 2004-07-06 13:56:28
"Howard Hinnant" wrote:
> > So are you saying that call_traits is *not* useful for said
> > optimization? If so, why not?
>
> For it to make a significant difference in performance, say for passing
> a parameter, the function would have to be very short - short enough
> that it should be inlined.
>
...
> On Metrowerks Pro 9.2 / Mac I've just run the following experiment:
>
>
> I've looked at the generated (optimized) assembly of main, using both
> foo1 and foo2. The assembly is identical in both cases. No doubt I
> could come up with examples where the assembly is different.
>
More complex programs may not inline the function and difference
will show up.
Experimental version of STLport with call_traits like optimisation
got ~5% speedup for vector<int>::push_back().
/Pavel
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk