"H. S. Teoh" <[email protected]> wrote in message news:[email protected]... > > Here's the current hashing code for char[] and string: > > foreach (char c; s) > hash = hash * 11 + c; > > For const(char)[], it's rt.util.hash.hashOf, which is Paul Hsieh's > SuperFastHash algorithm with very good hash distribution properties. It > does seem to involve a lot more operations that the simple loop above, > though; so I assume the above simple loop was chosen because hashing > strings are a very common operation and, for the most part, only need a > simple hash function. > > So I'm kinda leaning towards SuperFastHash, but worried about whether it > will cause performance degradation, in which case we should stick with > the simple loop. > > > T > > -- > "Maybe" is a strange word. When mom or dad says it it means "yes", but > when my big brothers say it it means "no"! -- PJ jr.
Benchmark time!
