hanchenye-llvm-project/lld/COFF
Peter Collingbourne 6ee0b4e9f5 COFF: Open and map input files asynchronously on Windows.
Profiling revealed that the majority of lld's execution time on Windows was
spent opening and mapping input files. We can reduce this cost significantly
by performing these operations asynchronously.

This change introduces a queue for all operations on input file data. When
we discover that we need to load a file (for example, when we find a lazy
archive for an undefined symbol, or when we read a linker directive to
load a file from disk), the file operation is launched using a future and
the symbol resolution operation is enqueued.  This implies another change
to symbol resolution semantics, but it seems to be harmless ("ninja All"
in Chromium still succeeds).

To measure the perf impact of this change I linked Chromium's chrome_child.dll
with both thin and fat archives.

Thin archives:

Before (median of 5 runs): 19.50s
After: 10.93s

Fat archives:

Before: 12.00s
After: 9.90s

On Linux I found that doing this asynchronously had a negative effect on
performance, probably because the cost of mapping a file is small enough that
it becomes outweighed by the cost of managing the futures. So on non-Windows
platforms I use the deferred execution strategy.

Differential Revision: https://reviews.llvm.org/D27768

llvm-svn: 289760
2016-12-15 04:02:23 +00:00
..
CMakeLists.txt build: add support for standalone lld build 2016-12-12 05:47:40 +00:00
Chunks.cpp COFF: New symbol table design. 2016-12-09 21:55:24 +00:00
Chunks.h COFF: New symbol table design. 2016-12-09 21:55:24 +00:00
Config.h Create a TPI stream only when /debugpdb is given. 2016-12-10 17:23:23 +00:00
DLL.cpp COFF: New symbol table design. 2016-12-09 21:55:24 +00:00
DLL.h
Driver.cpp COFF: Open and map input files asynchronously on Windows. 2016-12-15 04:02:23 +00:00
Driver.h COFF: Open and map input files asynchronously on Windows. 2016-12-15 04:02:23 +00:00
DriverUtils.cpp COFF: Fix test failure on Windows. 2016-12-09 23:34:49 +00:00
Error.cpp Start using make() in COFF (with a smaller change.) 2016-12-08 19:10:28 +00:00
Error.h Needed change to lld for the changes to libObject/Archive interfaces now returning Expected<> 2016-08-03 21:58:48 +00:00
ICF.cpp COFF: New symbol table design. 2016-12-09 21:55:24 +00:00
InputFiles.cpp COFF: Open and map input files asynchronously on Windows. 2016-12-15 04:02:23 +00:00
InputFiles.h COFF: Open and map input files asynchronously on Windows. 2016-12-15 04:02:23 +00:00
Librarian.cpp Remove unnecessary `llvm::`. 2016-12-08 20:50:47 +00:00
MarkLive.cpp COFF: New symbol table design. 2016-12-09 21:55:24 +00:00
ModuleDef.cpp Fix -Wunused-private-field. 2016-12-08 21:49:18 +00:00
Options.td Create a TPI stream only when /debugpdb is given. 2016-12-10 17:23:23 +00:00
PDB.cpp Create a TPI stream only when /debugpdb is given. 2016-12-10 17:23:23 +00:00
PDB.h Emit Section Contributions. 2016-11-12 00:00:51 +00:00
README.md Update the documents of the new LLD. 2016-03-12 06:06:40 +00:00
Strings.cpp Fix Windows buildbots. 2016-12-07 23:24:32 +00:00
Strings.h COFF: Define overloaded toString functions. 2016-12-07 23:17:02 +00:00
SymbolTable.cpp COFF: Open and map input files asynchronously on Windows. 2016-12-15 04:02:23 +00:00
SymbolTable.h COFF: Open and map input files asynchronously on Windows. 2016-12-15 04:02:23 +00:00
Symbols.cpp COFF: Fix memory leaks reported by lsan. 2016-12-12 18:42:09 +00:00
Symbols.h COFF: Open and map input files asynchronously on Windows. 2016-12-15 04:02:23 +00:00
Writer.cpp COFF: Use a bit in SymbolBody to track which symbols are written to the symbol table. 2016-12-11 22:15:20 +00:00
Writer.h Re-submit r283825: Add section header stream to PDB. 2016-10-11 19:45:07 +00:00

README.md

See docs/NewLLD.rst