about summary refs log tree commit diff
path: root/src/bootstrap
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2018-12-13 03:35:15 +0000
committerbors <bors@rust-lang.org>2018-12-13 03:35:15 +0000
commitced7cc5c6523ff478599ed9188df37e91fd96c68 (patch)
treedccfd0a0b4e2b303740566fd08e0bf6fc8c4db35 /src/bootstrap
parent2f35a1016b0c0cc1132c19875dcd88d7b2825eae (diff)
parent209240dc267075d69eb8d1dba23be2a8c80c6427 (diff)
downloadrust-ced7cc5c6523ff478599ed9188df37e91fd96c68.tar.gz
rust-ced7cc5c6523ff478599ed9188df37e91fd96c68.zip
Auto merge of #56090 - nnethercote:filesearch, r=eddyb
Overhaul `FileSearch` and `SearchPaths`

`FileSearch::search()` traverses one or more directories. For each
directory it generates a `Vec<PathBuf>` containing one element per file
in that directory.

In some benchmarks this occurs enough that the allocations done for the
`PathBuf`s are significant, and in practice a small number of
directories are being traversed over and over again. For example, when
compiling the `tokio-webpush-simple` benchmark, two directories are
traversed 58 times each. Each of these directories have more than 100
files.

We can do all the necessary traversals up front, when `Session` is created,
and get the `Vec<PathBuf>`s then.

This reduces instruction counts on several benchmarks by 1--5%.

r? @alexcrichton

CC @eddyb, @michaelwoerister, @nikomatsakis
Diffstat (limited to 'src/bootstrap')
-rw-r--r--src/bootstrap/builder.rs5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/bootstrap/builder.rs b/src/bootstrap/builder.rs
index 7dc64db70b8..32f3e573d68 100644
--- a/src/bootstrap/builder.rs
+++ b/src/bootstrap/builder.rs
@@ -684,6 +684,11 @@ impl<'a> Builder<'a> {
             .env("RUSTDOC_REAL", self.rustdoc(host))
             .env("RUSTDOC_CRATE_VERSION", self.rust_version())
             .env("RUSTC_BOOTSTRAP", "1");
+
+        // Remove make-related flags that can cause jobserver problems.
+        cmd.env_remove("MAKEFLAGS");
+        cmd.env_remove("MFLAGS");
+
         if let Some(linker) = self.linker(host) {
             cmd.env("RUSTC_TARGET_LINKER", linker);
         }