|
Boost : |
From: David Abrahams (dave_at_[hidden])
Date: 2004-07-06 15:32:26
"David B. Held" <dheld_at_[hidden]> writes:
> "Howard Hinnant" <hinnant_at_[hidden]> wrote in message
> news:FAEED0B1-CF6E-11D8-8C1A-003065D18932_at_twcny.rr.com...
>> [...]
>> 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.
>> [...]
>> But I'm having more trouble coming up with a situation where
>> the performance difference is enough that I'd want to start lacing
>> my generic code with call_traits for this purpose. However if you
>> have such examples, I'm interested in pursuing this further.
>
> Well, I started using it in policy_ptr, where basically all the functions
> *are* very short and inlined, where performance matters, and where
> the library doesn't know what types are going to be passed to it. I
> think in the vast majority of cases, it won't make a difference,
> because a fundamental pointer type will be used; but I like to
> think that I'm improving the QoI by using it anyway.
This might well be premature optimization. I'm not sure added
complexity is ever a QOI improvement unless it is proven to improve
usability or performance.
-- Dave Abrahams Boost Consulting http://www.boost-consulting.com
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk