<html><head></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><br><div><div>On Feb 15, 2012, at 2:05 AM, Jeffrey Yasskin wrote:</div><blockquote type="cite"><div>On Tue, Feb 14, 2012 at 2:44 AM, Chris Lattner <<a href="mailto:clattner@apple.com">clattner@apple.com</a>> wrote:<blockquote type="cite">I'm contradicting my stance above about not caring about the implementation<br></blockquote><blockquote type="cite">:), but is MurmurHash a good hash for string data?  The Bernstein hash<br></blockquote><blockquote type="cite">function works really well and is much cheaper to compute than Murmur.<br></blockquote><br>Have you seen benchmarks saying that, or are you just guessing from<br>the length of the code? The benchmarks I've seen say the opposite:<br><a href="http://code.google.com/p/smhasher/wiki/MurmurHash3#Bulk_speed_test,_hashing_an_8-byte-aligned_256k_block">http://code.google.com/p/smhasher/wiki/MurmurHash3#Bulk_speed_test,_hashing_an_8-byte-aligned_256k_block</a><br>and http://code.google.com/p/cityhash/source/browse/trunk/README.<br><br></div></blockquote><div><br></div><div>These are the numbers I come up with, graphing time (ns) vs. string length (chars), using the current Xcode compiler, 64-bit, -O3. </div><div>Bernstein is inlined while Murmor and CityHash are not:</div></div><img id="429afc6b-4fca-4e89-a473-c6f7bea6fb57" height="447" width="579" apple-width="yes" apple-height="yes" src="cid:EEAB68CF-FD15-49DB-8C10-C44F7BE46E10@austin.rr.com"><div><div><br></div></div></body></html>