On Tue, Jul 04, 2006 at 12:53:09AM +0900, Juergen Strobel wrote:
> On Mon, Jul 03, 2006 at 10:31:55AM +0900, Francis Cianfrocca wrote:
> > On 7/2/06, M. Edward (Ed) Borasky <znmeb / cesmail.net> wrote:
> > Ah ... now searching is something we *can* optimize!
> > 
> > Searching can be improved but even so, it's a lot of work to do at runtime.
> > Languages that treat method dispatch as lookups into indexed tables have a
> > big edge. Even Python does this.
> 
> Lisp (CLOS) has an even more complicated method dispatch than Ruby,
> since it may have to search up the parent classes of all parameters
> (multi dispatch) and MI is allowed. History shows this type of method
> dispatch can be highly optimized and be made very performant.

Ruby's method cache hit rate was over 98% IIRC so full searches are relatively
rare, but... method dispatching is still fairly slow. I'd bet YARV will use
inline method caches at some point (it did already have ICs for constant
lookup last time I read the sources) ;)

-- 
Mauricio Fernandez  -   http://eigenclass.org   -  singular Ruby