Skip to content

Commit 383be89

Browse files
committedJan 5, 2019
[LLD][COFF] PDB: Parallel sort publics
Saves up to 1.3 sec on large PDBs. Figures below are for the "Globals Stream Layout" pass: Before This patch Large EXE (PDB is ~2 GB) 3330 ms 2022 ms Large EXE (PDB is ~2 GB) 2680 ms 1608 ms Large DLL (PDB is ~1 GB) 1455 ms 938 ms Large DLL (PDB is ~800 MB) 1215 ms 800 ms Small DLL (PDB is ~200 MB) 224 ms 146 ms Differential Revision: https://reviews.llvm.org/D56334 llvm-svn: 350452
1 parent 9f0c21c commit 383be89

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed
 

‎lld/COFF/PDB.cpp

+5-4
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@
5353
#include "llvm/Support/Errc.h"
5454
#include "llvm/Support/FormatVariadic.h"
5555
#include "llvm/Support/JamCRC.h"
56+
#include "llvm/Support/Parallel.h"
5657
#include "llvm/Support/Path.h"
5758
#include "llvm/Support/ScopedPrinter.h"
5859
#include <memory>
@@ -1387,10 +1388,10 @@ void PDBLinker::addObjectsToPDB() {
13871388

13881389
if (!Publics.empty()) {
13891390
// Sort the public symbols and add them to the stream.
1390-
std::sort(Publics.begin(), Publics.end(),
1391-
[](const PublicSym32 &L, const PublicSym32 &R) {
1392-
return L.Name < R.Name;
1393-
});
1391+
sort(parallel::par, Publics.begin(), Publics.end(),
1392+
[](const PublicSym32 &L, const PublicSym32 &R) {
1393+
return L.Name < R.Name;
1394+
});
13941395
for (const PublicSym32 &Pub : Publics)
13951396
GsiBuilder.addPublicSymbol(Pub);
13961397
}

0 commit comments

Comments
 (0)
Please sign in to comment.