Nick Ing-Simmons wrote:
> Cross posted to internals ('cos it is...)
Be it on your head... ;-)
> We should consider using "vtables" to avoid the cost of the conditional
> branches (and running out of flag bits).
>
> Thus this function would call variables "type check" "method" -
> which for normal case would be pointer to blue-white-hot "NoOp" function
> which is near always in-cache, for a typed var it could be a slow
> as you wanted...
Hmm. I'm not at all convinced that this analysis is correct. Even if
the called function is in cache, the overhead of making a call probably
dwarfs that of the actual contents of such a simple call, and I suspect
that for perl the real cache clobbering hits the D cache rather than the
I cache. I suspect reorganising the data structures to be cache
friendly would gain more benefit than avoiding a few inline bit
twiddles.
I think a range of alternative implementation mechanisms needs to be
benchmarked very carefully on a range of architectures before making a
choice. The one thing that is certain about cache behaviour is that it
is very difficult to predict without actually trying stuff out.
Alan Burlison