diff options
| author | bors <bors@rust-lang.org> | 2014-07-30 07:41:11 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2014-07-30 07:41:11 +0000 |
| commit | 774d5eb0b07bdb4d3c853159fbcd265de60e7755 (patch) | |
| tree | 39c10ef88e6271df5a230b5d738046e4586950c2 /src/rustllvm/RustWrapper.cpp | |
| parent | 1b0dc6a3fc22b299152e7a29d98896cca7fd6fa2 (diff) | |
| parent | 4d8de63fb3159dc31fc3c3f54c4a39794e694edf (diff) | |
| download | rust-774d5eb0b07bdb4d3c853159fbcd265de60e7755.tar.gz rust-774d5eb0b07bdb4d3c853159fbcd265de60e7755.zip | |
auto merge of #15670 : epdtry/rust/fast-archive-builder, r=alexcrichton
When rustc produces an rlib, it includes the contents of each static library required by the crate. Currently each static library is added individually, by extracting the library with `ar x` and adding the objects to the rlib using `ar r`. Each `ar r` has significant overhead - it appears to scan through the full contents of the rlib before adding the new files. This patch avoids most of the overhead by adding all library objects (and other rlib components) at once using a single `ar r`. When building `librustc` (on Linux, using GNU ar), this patch gives a 60-80% reduction in linking time, from 90s to 10s one machine I tried and 25s to 8s on another. (Though `librustc` is a bit of a special case - it's a very large crate, so the rlib is large to begin with, and it also relies on a total of 45 static libraries due to the way LLVM is organized.) More reasonable crates such as `libstd` and `libcore` also get a small reduction in linking time (just from adding metadata, bitcode, and object code in one `ar` invocation instead of three), but this is not very noticeable since the time there is small to begin with (around 1s).
Diffstat (limited to 'src/rustllvm/RustWrapper.cpp')
0 files changed, 0 insertions, 0 deletions
