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.


In reply to Re^3: Can you speed up method calls by eliminating method dispatch? by ikegami
in thread Can you speed up method calls by eliminating method dispatch? by missingthepoint

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.