On Thu, 2008-10-09 at 12:07 -0700, Aleksandar Donev wrote:
> On Thursday 09 October 2008 12:01, Neil N. Carlson wrote:
> > So if reducing runtime overhead is of prime importance, it
> > would be better to use procedure pointer components instead
> > where necessary.
> But Bill made an important point: If you have lots of objects of the same
> type, say an array, you don't want to be fetching the same address N times.
> The memory traffic overhead is much worse than a simple additional
> de-reference amortized over the whole array.
Oh right, I forgot that array elements must all have the same dynamic
type so that such an optimization is possible. (In my particular case
I wanted to stuff different dynamic types into a (small) array, but I
guess that won't work... array of boxed class pointers perhaps...)
-Neil
--
Neil N. Carlson <[log in to unmask]>
|