On Mon, 21 Nov 2005, URABE Shyouhei wrote:

> Mathieu Bouchard wrote:
> > when it's big enough for its number of entries,
> I think that can hardly happen. Have you ever seen a object includes hundreds
> of instance variables?

I think that you don't understand what I mean. I mean: as long as the
capacity of the hashtable is roughly proportional to its size (number of
keys), you'll have average-constant-time behaviour, because the average
number of keys you have to iterate through will be on average a very small
constant. That's what Ruby does, for all its hashes (be them Hash objects
or @-variable hashes or Constants hashes, etc), as a Ruby hashatable
reallocates itself every time its size becomes too big for its capacity.

____________________________________________________________________
Mathieu Bouchard - t?l:+1.514.383.3801 - http://artengine.ca/matju
Freelance Digital Arts Engineer, Montr?al QC Canada