Hello Yukihiro,

Monday, September 30, 2002, 1:56:25 PM, you wrote:

YM> No.  Tree search result is stored in the cache, whose hit rate is more
YM> than 95%.  It means hash seach traversing inheritance tree happens 1
YM> to 20.  If Ruby is slow (and in fact it is), I think there's other
YM> bottlenecks than method dispatching.

YM> |consider two examples i stated above. in C and in Ruby. so...?

YM> I was talking about Ruby's bottleneck, no comparison against other
YM> compiled languages.

well. consider "2+2" example. when we compile ruby to c, we need to
dispatch to Fixnum.+ method. if we exactly know what Fixnum.+ body is:

Fixnum +(Fixnum b)
  return integer_add( self.representation, b.representation)
end

then we can compile "2+2" to just one c/asm instruction. if we don't
know, we have to call rb_funcall with all those overhead. so, if i'm
right, strong typing is the first and most important step to fast
compiled code. i say nothing about interpreter, it is topic for another
discussion

-- 
Best regards,
 Bulat                            mailto:bulatz / integ.ru