[lld] r308544 - Speed up gdb index creation.

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


>> I did these benchmarks today, used clang objects and reproduce from clang-gdb-index folder
>> of lld-speed-test.tar.xz archive you posted earlier (thanks, btw !) and results are below:
>>
>> * ld.gold with --gdb-index: 26.54s
>> * ld.lld     with --gdb-index: 15.33s
>> * ld.gold w/o --gdb-index: 21.65s
>> * ld.lld     w/o --gdb-index: 10.14s
>>
>> Both LLD and ld.gold spends about 5 seconds for building gdb-index.
>
>Nice, I was not expecting that as we have a plain std::find over the
>relocations :-)
>
>In any case, we can profile and try to speed it up, but it is probably
>good enough to try to parallelize too.
>
>Cheers,
>Rafael

I used profiler to check where we are slow and it pointed on std::find,
so your expectations about it is slow are correct :)
I prepared a patch which speedups things for about 55%. 
It is "[ELF] - Speedup .gdb_index building with use of relocation caching layer." (https://reviews.llvm.org/D36077).

With this patch applied profiler shows different slowest place, 
which I did not yet check, so there should be room to speedup more.

Btw I used new technique for benchmarking .gdb_index. I included benchmark inside
LLD and running index building in a loop, and calculate average, min and max values.
I uploaded demo of what I am doing here: D36076. 
I believe it should show more precise results when estimating perfomance.

George.


More information about the llvm-commits mailing list