Re:LLD is included in the upcoming LLVM 4.0 release
by rui314 on Friday February 17, 2017 @05:13PM
(#13672172)
Linkers have to copy large amount of data from object files to an output file, and that is inevitably slow. But LLD is not that bad if you pass -O0 (which disables string merging, which is computationally expensive). For example, LLD takes 6.7 seconds to link clang with debug info on my machine.
Copying the output file to other file takes 2.6 seconds.
So, LLD is only 2.5x slower than cp in this case. That's not too bad, as apparently the linker has many more things to do than the cp command.
[ Parent
| on HN ]
Re:LLD is included in the upcoming LLVM 4.0 release
by jblow on Friday February 17, 2017 @08:24PM
(#13673095)
Is your test mostly waiting on a mechanical hard drive? If so, then "2.5x slower than cp" could mean "a very large amount slower than cp" once you remove that overhead.
Whereas I have not done your specific test, I know that for the file sizes of executables I deal with in everyday work (around 10MB), the amount of time I wait for linking is woefully disproportionate.
Re:LLD is included in the upcoming LLVM 4.0 release
by aseipp on Saturday February 18, 2017 @01:38AM
(#13673877)
For a comparison, an optimized release build of Clang 5.0 trunk (from a few days ago, built with Clang 5.0 trunk from like a week ago) with assertions enabled is 87mb -- with the LLVM libraries linked in, but dynamically linked to system libraries, on my Fedora 25 machine.
A debug build of clang is normally hundreds of megabytes (~600mb IIRC, and normal linkers go bonkers dealing with it), so if LLD is actually only 2.5x slower than 'cp' at -O0, that's quite good I think.
The next question is how much memory LLD uses vs the competition in this test...
Re:LLD is included in the upcoming LLVM 4.0 release
by rui314 on Friday February 17, 2017 @08:42PM
(#13673161)
It is on an SSD.