[PATCH] D97396: Use the default seed value for djb hash for StringMap

Jonas Devlieghere via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Feb 25 18:39:35 PST 2021


JDevlieghere accepted this revision.
JDevlieghere added a comment.
This revision is now accepted and ready to land.

In D97396#2585840 <https://reviews.llvm.org/D97396#2585840>, @serge-sans-paille wrote:

> In D97396#2585265 <https://reviews.llvm.org/D97396#2585265>, @JDevlieghere wrote:
>
>>> The performance gain was worth doing the test update.
>>
>> How did you measure this and what were the results?
>
> I ran the following before / after the patch:
>
>   curl -L -O https://github.com/azadkuh/sqlite-amalgamation/raw/master/sqlite3.c
>   perf stat -e instructions clang -O0 -c sqlite3.c -o/dev/null -w
>
> And compared the instruction count reported. This is similar to the approach taken by http://llvm-compile-time-tracker.com/ and confirms the literature about the default seed for that hashing function.
>
> Before the patch: 6,139,868,068 instructions
> After the patch:    6,137,774,225 instructions

Thanks!

In D97396#2585961 <https://reviews.llvm.org/D97396#2585961>, @MaskRay wrote:

> It'd be nice if tools have less reliance on the iteration order, even if they are stable on 32-bit and 64-bit machines. The test updates suggest to me that llvm-dwarfdump may need a fix.

+1

LGTM


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D97396/new/

https://reviews.llvm.org/D97396



More information about the llvm-commits mailing list