[LLVMdev] We need better hashing

Chris Lattner clattner at apple.com
Wed Feb 15 11:58:32 PST 2012

On Feb 15, 2012, at 12:05 AM, Jeffrey Yasskin wrote:
>>  void add(StringRef StrVal) {
>>     addImpl(StrVal.data(), StrVal.size());
>>   }
>> I'm contradicting my stance above about not caring about the implementation
>> :), but is MurmurHash a good hash for string data?  The Bernstein hash
>> function works really well and is much cheaper to compute than Murmur.
> Have you seen benchmarks saying that, or are you just guessing from
> the length of the code? The benchmarks I've seen say the opposite:
> http://code.google.com/p/smhasher/wiki/MurmurHash3#Bulk_speed_test,_hashing_an_8-byte-aligned_256k_block
> and http://code.google.com/p/cityhash/source/browse/trunk/README.

The compiler's use case is not typically a 256K long string.  I'm speaking from experience tuning the clang preprocessor identifier lookup table.


More information about the llvm-dev mailing list