From: Bill Kelly Date: 2003-03-03T09:26:21+09:00 Subject: Re: Is Ruby slower? Hi, From: "Mauricio Fern�ndez" > * however, a perf. increase of 1-3% can be achieved by setting the > number of bins in the hash to be a power of 2, so that we can later > use bitwise AND instead of the modulus operator [I assume our hash is > good enough not to increase the num. of collisions a lot] 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... HTH, Bill