On Sunday 02 March 2003 09:07 pm, Mike Campbell wrote: > > > Sorry if this contribution is "newbie-like" as I'm not an expert > > > in any kind of mathematical/analytical field, but... Just wanted > > > to mention that my Sedgewick algorithms book goes into a bit of > > > detail on why prime numbers should generate better distributed > > > hash values using the modulo operator than powers-of-two... > > > > Mathematically, that is true. However, if you analyze the computational > > aspects, the impact is not obvious, as you are decreasing collisions at > > the cost of a more expensive hash generation algorithm. I'm not saying > > that it definitely wouldn't pay off, but the answer is not obvious, and > > my belief is that there would be a small net loss. > > Beliefs are fine, but if this is going to make a big difference either way > in ruby, wouldn't a *test* be warranted? Certainly. I am just saying don't _assume_ it will be faster, or slower for that matter. I would like to see the results of any testing. -- Seth Kurtzberg M. I. S. Corp. 480-661-1849 seth / cql.com