in reply to Re^2: Can you speed up method calls by eliminating method dispatch?
in thread Can you speed up method calls by eliminating method dispatch?
The point was that calling the method added the method to the child's namespace so that @ISA needs not be scanned on later calls to that method.
Your questions go way beyond that, but I'll be happy to answer them anyway.
I think (some sort of NULL pointer changes to be a pointer to a CV, which new pointer holds the same address as Base::f's pointer?)
The CV field of the structure is the CODE slot of the glob. (See perldata)
I was showing that *Child::f{CODE} was assigned *Base::f{CODE}. That means Base::f and Child::f are the same function at that point.
do you mean "this CVGEN 'slot' is used for nothing else than method dispatch"?
*Child::f{CODE} is effectively undefined for everything that isn't a method call when CVGEN is true.
No idea what 0x4d is, but within struct gp in gp.h, there is [generational validity of cached gv_cv]
The cached entries need to be expired when there's a change to an @ISA, but keeping track of all the cached entries would require a fair amount of resource.
Instead of clearing all the cached entries (which would require keeping track of them), changing any @ISA simply increments a counter. If the cache's counter (CVGEN) is lower than the change counter, the cache is stale and thus ignored.
Or so goes my understanding.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^4: Can you speed up method calls by eliminating method dispatch?
by missingthepoint (Friar) on Jul 10, 2009 at 03:40 UTC |