[PATCH] D36077: [ELF] - Speedup .gdb_index building with use of relocation caching layer.

George Rimar via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Jul 31 02:00:53 PDT 2017


grimar created this revision.
Herald added a subscriber: emaste.

This patch introduces relocation caching helper.
Instead of plain std::find by offset, caching helper
allows either to take relocation from cache or
to continue searching from last unvisited relocation.

That gives speedup by 55%. I used built-in benchmark for
perfomance estimating (https://reviews.llvm.org/D36076). It runs .gdb_index building in
a loop and calculated average time.
After 50 runs, results are:

- With patch: Avg: 2.700828e+00, N: 50 Min: 2.658942e+00, Max: 2.729724e+00, Last: 2.717378e+00
- W/o patch: Avg: 4.903375e+00, N: 50 Min: 4.889383e+00, Max: 4.949485e+00, Last: 4.928791e+00

2.7/4.9 == 0.551

I also tried traditional benchmarking approach, linked debug clang
(used clang objects and reproduce from clang-gdb-index folder 
of lld-speed-test.tar.xz archive posted by Rafael earlier)

Without patch time is: 15,026934140 seconds time elapsed  ( +-  0,50% )
With patch: 12,907121321 seconds time elapsed ( +-  0,72% )

So it is 15.02 / (15.02 - 12.9) == 7.08% speedup of total link timewith --gdb-index, 
though calculations are not so accurate as built-in benchmark above shows.


https://reviews.llvm.org/D36077

Files:
  ELF/GdbIndex.cpp
  ELF/GdbIndex.h

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D36077.108880.patch
Type: text/x-patch
Size: 3850 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20170731/a0739803/attachment-0001.bin>


More information about the llvm-commits mailing list