See original comment in 560ce2c70fb1fe8e4b9b5e39c54e494a50373ba8
Basically the default seed value results in less collision, but changes the
iteration order, which matters for a few test cases.
The performance gain was worth doing the test update.
Paths
| Differential D97396
Use the default seed value for djb hash for StringMap ClosedPublic Authored by serge-sans-paille on Feb 24 2021, 9:15 AM.
Details Summary See original comment in 560ce2c70fb1fe8e4b9b5e39c54e494a50373ba8 The performance gain was worth doing the test update.
Diff Detail
Event TimelineComment Actions
How did you measure this and what were the results? Comment Actions
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 Comment Actions LG. The compiler may spend a lot of time in common data structures like DenseMap. It is possible that some contributors may want to optimize the data structures. 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. Comment Actions
Thanks!
+1 LGTM This revision is now accepted and ready to land.Feb 25 2021, 6:39 PM This revision was landed with ongoing or failed builds.Mar 1 2021, 4:21 AM Closed by commit rGd84440ec9190: Use the default seed value for djb hash for StringMap (authored by serge-sans-paille). · Explain Why This revision was automatically updated to reflect the committed changes.
Revision Contents
Diff 327081 llvm/lib/Support/StringMap.cpp
llvm/test/DebugInfo/Generic/accel-table-hash-collisions.ll
llvm/test/DebugInfo/Generic/debug-names-hash-collisions.ll
llvm/test/DebugInfo/X86/debug-pubtables-dwarf64.ll
llvm/test/DebugInfo/X86/gnu-public-names.ll
llvm/test/tools/llvm-dwarfdump/X86/section_sizes_elf.test
llvm/test/tools/llvm-dwarfdump/X86/section_sizes_macho.test
llvm/test/tools/llvm-dwarfdump/X86/statistics.ll
|