[cfe-dev] RFC: change string hash function in libc++

Chandler Carruth chandlerc at google.com
Fri Dec 2 18:03:56 PST 2011


On Fri, Dec 2, 2011 at 5:59 PM, Craig Silverstein <csilvers at google.com>wrote:

> Here are the updated results, including City64, which is probably a
> better candidate here than City128.  The data is a little noisy, but
> it looks like City64 is faster than Murmur3F starting at
> around 8-byte strings.
>
> Answering another question, Austin said all tests were performed on an
> x86_64 machine with gcc 4.6.x, with code compiled via gcc -O2.
> Results can differ on different platforms/compilers/etc, making the
> choice of a 'best' hash function difficult.  Overall, I think either
> cityhash or murmurhash would be great choices, and better than what
> exists in libc++ now.  I don't want to get too bogged down in choosing
> between them.
>

Agreed, but thanks for at least providing a baseline idea of the
performance of these routines.

Based on the data we have, my inclination would be to go with City64 for
64-bit architectures. For 32-bit architectures we could start with an
"obvious" port of City64, and potentially improve on it if needed in the
future. Let's see what Howard and others have to say though.

Also, I wonder about the code size impact. Any idea there? I'm not certain
it would be terribly relevant (hopefully there would be only one copy of
it) but it might...
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20111202/3a1b0d6b/attachment.html>


More information about the cfe-dev mailing list