[PATCH] D56334: [LLD][COFF] Parallel sort publics
Alexandre Ganea via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Fri Jan 4 14:33:18 PST 2019
aganea created this revision.
aganea added reviewers: rnk, zturner.
Herald added a subscriber: mgrang.
On large PDBs with many symbols, this can save up to 1 sec. On smaller PDBs, this saves time in all cases.
| | Trunk | This patch |
| 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 |
|
Repository:
rLLD LLVM Linker
https://reviews.llvm.org/D56334
Files:
COFF/PDB.cpp
Index: COFF/PDB.cpp
===================================================================
--- COFF/PDB.cpp
+++ 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>
@@ -213,7 +214,7 @@
std::vector<pdb::SecMapEntry> SectionMap;
/// Type index mappings of type server PDBs that we've loaded so far.
- std::map<GUID, CVIndexMap> TypeServerIndexMappings;
+ std::map<codeview::GUID, CVIndexMap> TypeServerIndexMappings;
/// Type index mappings of precompiled objects type map that we've loaded so
/// far.
@@ -221,7 +222,7 @@
/// List of TypeServer PDBs which cannot be loaded.
/// Cached to prevent repeated load attempts.
- std::map<GUID, std::string> MissingTypeServerPDBs;
+ std::map<codeview::GUID, std::string> MissingTypeServerPDBs;
};
class DebugSHandler {
@@ -507,7 +508,7 @@
}
static Expected<std::unique_ptr<pdb::NativeSession>>
-tryToLoadPDB(const GUID &GuidFromObj, StringRef TSPath) {
+tryToLoadPDB(const codeview::GUID &GuidFromObj, StringRef TSPath) {
// Ensure the file exists before anything else. We want to return ENOENT,
// "file not found", even if the path points to a removable device (in which
// case the return message would be EAGAIN, "resource unavailable try again")
@@ -550,7 +551,7 @@
TypeDeserializer::deserializeAs(const_cast<CVType &>(FirstType), TS))
fatal("error reading record: " + toString(std::move(EC)));
- const GUID &TSId = TS.getGuid();
+ const codeview::GUID &TSId = TS.getGuid();
StringRef TSPath = TS.getName();
// First, check if the PDB has previously failed to load.
@@ -1387,10 +1388,10 @@
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);
}
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D56334.180322.patch
Type: text/x-patch
Size: 2335 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20190104/0a1fbe1c/attachment.bin>
More information about the llvm-commits
mailing list