From: Robert Dober Date: 2009-07-29T04:20:02+09:00 Subject: Re: Indexing hash with longer strings faster? On Tue, Jul 28, 2009 at 9:16 PM, Robert Dober wrote: > 2009/7/28 Mladen Jablanović : > Is this 1.8? > Given your results it is not completely unthinkable that the hash > values for "00".."99" have more collisions and if collision handling > is with linked lists that might slow down. > A priori I would not believe in that but why not check? > > I get in 1.9 the expected >  [*"00".."99"].map( &:hash ).uniq.size > => 100 > > can you try this in 1.8 >  ...map{ |x| x.hash }.uniq.size > Sorry forgot two things you did not produce 00, 01, thus [*0..99].map( &:to_s ).map( a:hash ) and secondly, a negative result does not say anything about collisions, only a positive (result < 100) would. In that case we would need to look into the source, ( I do not think profiling might show internal hash behavior ). Cheers Robert > ? > > HTH > Robert > -- > Toutes les grandes personnes ont d’abord été des enfants, mais peu > d’entre elles s’en souviennent. > > All adults have been children first, but not many remember. > > [Antoine de Saint-Exupéry] > -- Toutes les grandes personnes ont d’abord été des enfants, mais peu d’entre elles s’en souviennent. All adults have been children first, but not many remember. [Antoine de Saint-Exupéry]