If this ok, once it is in I will experiment with xxhash to see if it is even better. I will also check if there is desire to move this (or xxhash) to llvm.
The speedups I got when building with llvm lto were
firefox
master 8.180250337 patch 7.205933333 1.13521038275x faster
chromium
master 4.43514035 patch 4.253562196 1.04268849158x faster
chromium fast
master 1.962154622 patch 1.805858212 1.08654965764x faster
the gold plugin
master 0.374364145 patch 0.322151729 1.16207398968x faster
clang
master 0.629810409 patch 0.548644689 1.1479385869x faster
llvm-as
master 0.036080885 patch 0.031719355 1.1375037418x faster
the gold plugin fsds
master 0.397731951 patch 0.348331855 1.1418190593x faster
clang fsds
master 0.707624537 patch 0.626803806 1.12894103422x faster
llvm-as fsds
master 0.032458039 patch 0.029188861 1.11200087595x faster
scylla
master 4.003780575 patch 3.23819983 1.2364217112x faster
and with gcc 6.1 (non lto):
firefox
master 7.7321452 patch 6.792662255 1.13830850258x faster
chromium
master 4.401358079 patch 4.231184832 1.04021881666x faster
chromium fast
master 1.99247151 patch 1.835671156 1.08541854214x faster
the gold plugin
master 0.379588529 patch 0.327329661 1.1596521007x faster
clang
master 0.636152202 patch 0.55581161 1.14454644443x faster
llvm-as
master 0.03697245 patch 0.032769466 1.12825915442x faster
the gold plugin fsds
master 0.404065327 patch 0.354658762 1.13930732945x faster
clang fsds
master 0.715435897 patch 0.635372078 1.12601091828x faster
llvm-as fsds
master 0.033349658 patch 0.030205179 1.1041039684x faster
scylla
master 3.807397873 patch 3.068759915 1.24069590925x faster
Should we allow the user a way to specify the fast, non-cryptographic hash --build-id=<something>? I think so, but I think the implementation detail (which of fnv1/murmur2/xxhash it actually is) is unnecessary.