Currently LLD uses LLVM DWARF parsers to scan objects
to find information required for building .gdb_index.
There are 2 known possible ways to speedup building index.
One of them is to use relocated output to produce .gdb_index (D31424),
that saves time because DWARF parsers don't need to apply some
amount of relocations on their side.
But way above looks does not allow to parallel generation. This
patch suggests to use parrallel_for loop when we scan input objects.
That gives significant speedup itself. And if we also land D32853 and D31136,
.gdb_index feature will be really much faster.
Numbers for this patch are below. I am using i7 4790K (4 phys cores, @4.0), ssd, 10 runs for each test.
Tried to link debug llc binary using LLD.
no --gdb-index option:
4,044980833 seconds time elapsed ( +- 0,45% )
with --gdb-index, without patch
18,688194986 seconds time elapsed ( +- 0,50% )
with --gdb-index, with patch
8,578650449 seconds time elapsed ( +- 0,32% )
That means gdb_index building time without patch is 18.688s - 4.044s = 14.664s.
Time after patch is 8.578s - 4.044s = 4.534s.
After patch we are 3.234x faster for my configuration.
Might make more sense to have one container containing a struct with 3 members, than 3 parallel containers like this?