[cfe-commits] [patch] change libc++'s string hash function to cityhash64

Craig Silverstein csilvers at google.com
Thu Dec 8 18:50:56 PST 2011


> SIZE (-O2):
> murmur2: 31841
> cityhash64: 36082    // 13.3% bigger

It turns out I was using a debug version of clang++, so all my numbers
were off.  I wouldn't have thought that debug vs release clang would
affect the binary output size, but apparently it does.  The new
numbers are much better:

RUN TIME (-O2):
cityhash64 (new):  8.80  (13% faster)
murmur2 (old):    10.10

COMPILE TIME (-O2)
new: 1.08
old: 1.08

BINARY SIZE (-O2)
new: 31402  (0.5% bigger)
old: 31257


COMPILE TIME (no flags):
cityhash64 (new): 0.96
murmur2 (old):    0.96

RUN TIME (no flags):
new: 15.60  (4% faster)
old: 16.20

COMPILE TIME (-g)
new: 1.21
old: 1.27

ALL SIZES:
  31402 Dec  8 18:32 /var/tmp/libcxx_test.O2.new
 346104 Dec  8 18:32 /var/tmp/libcxx_test.g.new
 303210 Dec  8 18:33 /var/tmp/libcxx_test.gO2.new

  31257 Dec  8 18:34 /var/tmp/libcxx_test.O2.old
 336295 Dec  8 18:34 /var/tmp/libcxx_test.g.old
 291417 Dec  8 18:34 /var/tmp/libcxx_test.gO2.old


Here I think the size/speed trade-off is more palatable.

craig



More information about the cfe-commits mailing list