On Wed, Mar 17, 2004 at 12:06:35PM -0500, Sterling Hughes wrote:
: >
: >That's all fine and good, and the generic method cache will help here. 
: >However... we can do better. What I'm thinking of is caching the 
: >actual found method PMC pointer in the class somewhere (hanging off 
: >the vtable or in the class' attributes or something) such that we 
: >don't actually have to *do* any method lookups. With the method PMC 
: >directly cached, we just call the darned thing and are done with it. 
: >No lookups at all, something definitely faster than actually looking 
: >anything up.
: >
: 
: How do you handle the threaded case with two private objects and 
: runtime method overloading?

I suspect Dan is primarily talking about public, single dispatch in
a (more-or-less) static, global class hierarchy.  Private dispatch
shouldn't be trying to use the public dispatcher in any case, in
my opinion, and Perl 6 will enforce that by making you call private
methods differently from public methods, to keep private things in a
completely separate namespace.  (Whether Parrot will have to confuse
the private and public dispatchers to support other languages is
another matter, of course...  But we'd prefer not to violate Liskov
substitutability just because you add a private method.)

Larry

Reply via email to