From: MikkelFJ Date: 2003-10-10T01:13:54+09:00 Subject: Re: Is Ruby slower? "Yukihiro Matsumoto" wrote in message news:1046421624.833733.22618.nullmailer@picachu.netlab.jp... > Hi, > > In message "Re: Is Ruby slower?" > on 03/02/28, Travis Whitton writes: > > |All it would take would be converting it over to fit the variables in st.c and > |adding another preprocessor conditional such as #elif HASH_JENKINS so as not to > |disturb the 3 other strhash implementations. Anyway, just an idea. You can read > |about Bob Jenkins hashing function at > |http://burtleburtle.net/bob/hash/doobs.html > > I will examine, when I have time to do. Probably we need to remove > prime modulo from st.c first. I have been working with Jenkins hash - I can't say if is the best, but it appears to be pretty good. I did an optimization on the hash function to operate on exactly 32bits in order get a fast integer map that grows and shrinks dynamically and which remembers the order of insertion - so it is an indexed list. I'm not sure if is any good in Ruby, but it is available upon request. It's only really faster than red/black trees (STL) when there many elements, more than 1000 elements and possibly slightly slower with less than 100 elements. Mikkel