[PATCH] D41993: [ELF] - Change shift2 constant of GNU_HASH from 6->11.

Rafael Avila de Espindola via llvm-commits llvm-commits at lists.llvm.org
Fri Jan 12 11:03:11 PST 2018


Do you know why this produces a better bloom filter?

George Rimar via Phabricator <reviews at reviews.llvm.org> writes:

> grimar created this revision.
> grimar added reviewers: espindola, ruiu.
> Herald added a subscriber: emaste.
>
> This is for PR35536 ("Bug 35536 - lld might be creating DSOs that takes more time to
> load for the dynamic loader than those created by gold").
>
> shift2 is shift count used by the Bloom filter.
>
> latest benchmark performed today of fresh configuration
> (previous my results are available on bug page)
> shows this change reduces run time of "ninja check-llvm"
> for LLVM built with and -DBUILD_SHARED_LIBS=ON from ~413.45s to ~401.93s.
> gold time is: ~411.1s
>
>
> https://reviews.llvm.org/D41993
>
> Files:
>   ELF/SyntheticSections.h
>
>
> Index: ELF/SyntheticSections.h
> ===================================================================
> --- ELF/SyntheticSections.h
> +++ ELF/SyntheticSections.h
> @@ -458,7 +458,7 @@
>    void addSymbols(std::vector<SymbolTableEntry> &Symbols);
>  
>  private:
> -  size_t getShift2() const { return Config->Is64 ? 6 : 5; }
> +  size_t getShift2() const { return Config->Is64 ? 11 : 5; }
>  
>    void writeBloomFilter(uint8_t *Buf);
>    void writeHashTable(uint8_t *Buf);
>
>
> Index: ELF/SyntheticSections.h
> ===================================================================
> --- ELF/SyntheticSections.h
> +++ ELF/SyntheticSections.h
> @@ -458,7 +458,7 @@
>    void addSymbols(std::vector<SymbolTableEntry> &Symbols);
>  
>  private:
> -  size_t getShift2() const { return Config->Is64 ? 6 : 5; }
> +  size_t getShift2() const { return Config->Is64 ? 11 : 5; }
>  
>    void writeBloomFilter(uint8_t *Buf);
>    void writeHashTable(uint8_t *Buf);


More information about the llvm-commits mailing list