
6 Jul
2004
6 Jul
'04
6:56 p.m.
"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