Some performance questions

Jarrett Billingsley jarrett.billingsley at gmail.com
Mon Feb 2 12:25:09 PST 2009


On Mon, Feb 2, 2009 at 3:11 PM, Chris Nicholson-Sauls
<ibisbasenji at gmail.com> wrote:
>
> Or he's caching some very big/complex parameters in the code he's actually
> writing... maybe. That said: do we have any assurance that, were the functor
> class tagged as 'final', the call would cease to be virtual?  If so, then
> the only extra cost on the call is that of the hidden "this" sitting in ESI.
>  I still don't care for the memory allocation involved, personally, but if
> these are long-lived functors that may not be a major problem.  (Ie, if he
> calls foo(?,X) a million times, the cost of allocating one object is
> amortized into nearly nothing.)

Oh, I suppose I should also point out that if you made these functors'
methods final, they wouldn't be able to implement interfaces, since
interface implementations must be virtual.  So, at that point, you're
using a final scope class - might as well use a struct anyway.


More information about the Digitalmars-d-learn mailing list