[PATCH] D24458: Using murmurhash2 instead of fnv

Rafael EspĂ­ndola via llvm-commits llvm-commits at lists.llvm.org
Tue Sep 13 10:27:54 PDT 2016


On 12 September 2016 at 13:29, Rui Ueyama <ruiu at google.com> wrote:
> ruiu added inline comments.
>
> ================
> Comment at: ELF/OutputSections.cpp:1744
> @@ -1696,3 +1743,3 @@
>  template <class ELFT>
> -void BuildIdFnv1<ELFT>::writeBuildId(ArrayRef<uint8_t> Buf) {
> +void BuildIdMurmur2<ELFT>::writeBuildId(ArrayRef<uint8_t> Buf) {
>    const endianness E = ELFT::TargetEndianness;
> ----------------
> I'd rename this class BuildIdNonCryptoHash or something like that because I think we'd want to change the implementation again in the future. Specifically, we want to use threads to make it faster, but if we do, it is no longer a Murmur hash (because Murmur(concat(X1, X2, ..., Xn)) is different from SomeHash(Murmur(X1), Murmur(X2), ..., Murmur(Xn)).)

I will rename it to BuildIdFastHash.

Note that we want to be careful about using threads in here. The
firgerprint is arbitrary, but it has to be reproducible. Running it on
machines with 4 and 8 cores should produce the same result.

Cheers,
Rafael


More information about the llvm-commits mailing list