diff options
author | Alexandre Ganea <alexandre.ganea@ubisoft.com> | 2019-01-05 01:16:24 +0000 |
---|---|---|
committer | Alexandre Ganea <alexandre.ganea@ubisoft.com> | 2019-01-05 01:16:24 +0000 |
commit | f13bb5b874597768501052a928f91a68c84523dc (patch) | |
tree | 8c5e414b852c6fb0f5b5b3a82254d838d3a318bf /lld | |
parent | 1c5e737f364277c4eafc7d865a71dfd564a03856 (diff) |
[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
Diffstat (limited to 'lld')
-rw-r--r-- | lld/COFF/PDB.cpp | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/lld/COFF/PDB.cpp b/lld/COFF/PDB.cpp index ae2defdca6f..c6e803737b3 100644 --- a/lld/COFF/PDB.cpp +++ b/lld/COFF/PDB.cpp @@ -53,6 +53,7 @@ #include "llvm/Support/Errc.h" #include "llvm/Support/FormatVariadic.h" #include "llvm/Support/JamCRC.h" +#include "llvm/Support/Parallel.h" #include "llvm/Support/Path.h" #include "llvm/Support/ScopedPrinter.h" #include <memory> @@ -1387,10 +1388,10 @@ void PDBLinker::addObjectsToPDB() { if (!Publics.empty()) { // Sort the public symbols and add them to the stream. - std::sort(Publics.begin(), Publics.end(), - [](const PublicSym32 &L, const PublicSym32 &R) { - return L.Name < R.Name; - }); + sort(parallel::par, Publics.begin(), Publics.end(), + [](const PublicSym32 &L, const PublicSym32 &R) { + return L.Name < R.Name; + }); for (const PublicSym32 &Pub : Publics) GsiBuilder.addPublicSymbol(Pub); } |