[PDB] Optimize public symbol processing
authorReid Kleckner <rnk@google.com>
Sun, 3 May 2020 16:29:03 +0000 (09:29 -0700)
committerReid Kleckner <rnk@google.com>
Fri, 8 May 2020 17:23:27 +0000 (10:23 -0700)
commit3b3e28a07cf5482db27581ecf23f6364b912f733
tree36ae9bb5ecd5458cbb06c8a7dfc8dd9577d49003
parent8cb86ead77417f889bf32a8f83da299215f78545
[PDB] Optimize public symbol processing

Reduces time to link PGO instrumented net_unittets.exe by 11% (9.766s ->
8.672s, best of three). Reduces peak memory by 65.7MB (2142.71MB ->
2076.95MB).

Use a more compact struct, BulkPublic, for faster sorting. Sort in
parallel. Construct the hash buckets in parallel. Try to use one vector
to hold all the publics instead of copying them from one to another.
Allocate all the memory needed to serialize publics up front, and then
serialize them in place in parallel.

Reviewed By: aganea, hans

Differential Revision: https://reviews.llvm.org/D79467
lld/COFF/PDB.cpp
llvm/include/llvm/DebugInfo/PDB/Native/GSIStreamBuilder.h
llvm/lib/DebugInfo/PDB/Native/GSIStreamBuilder.cpp