[PATCH] D45548: Avoid hash table lookup when sorting local symbols.

George Rimar via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Apr 12 02:51:56 PDT 2018


grimar added a comment.

Numbers I got after re-profiling this place today:

lld-speed-test\mozilla\response-O0.txt
(Configuration: `RelWithDebInfo`, used MSVS2015 built-in profiler)

Benchmarked execution time of
`lld::elf::SymbolTableBaseSection::postThunkContents`

- LLD vanilla r329846: Total CPU (%): 3.42 Total CPU (ms): 246

- Changed predicate to `return L.Sym->File < R.Sym->File;` Total CPU (%): 2.3 Total CPU (ms): 161

- My patch (https://reviews.llvm.org/D45519) applied: Total CPU (%): 0.72 Total CPU (ms): 49

- This (https://reviews.llvm.org/D45548) patch applied: Total CPU (%): 2.08 Total CPU (ms): 148

Results were pretty stable.
Versions with sorting ((2) and (4)) seem to show almost equal time, and I believe it is expected.
The approach used in my patch (3) is about 3 times faster than them. And does not require additional members.
So IMO it is better.


https://reviews.llvm.org/D45548





More information about the llvm-commits mailing list