Skip to content

Commit

Permalink
Rollup merge of rust-lang#81942 - the8472:reduce-ui-test-threads, r=M…
Browse files Browse the repository at this point in the history
…ark-Simulacrum

reduce threads spawned by ui-tests

The test harness already spawns enough tests to keep all cores busy.
Individual tests should keep their own threading to a minimum to avoid context switch overhead.

When running ui tests with lld enabled this shaves about 10% off that testsuite on my machine.

Resolves rust-lang#81946
  • Loading branch information
Dylan-DPC committed Mar 27, 2021
2 parents f8bf349 + be7fe62 commit a9dac65
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/bootstrap/test.rs
Expand Up @@ -1156,13 +1156,15 @@ note: if you're sure you want to do this, please open an issue as to why. In the
hostflags.push(format!("-Lnative={}", builder.test_helpers_out(compiler.host).display()));
if builder.is_fuse_ld_lld(compiler.host) {
hostflags.push("-Clink-args=-fuse-ld=lld".to_string());
hostflags.push("-Clink-arg=-Wl,--threads=1".to_string());
}
cmd.arg("--host-rustcflags").arg(hostflags.join(" "));

let mut targetflags = flags;
targetflags.push(format!("-Lnative={}", builder.test_helpers_out(target).display()));
if builder.is_fuse_ld_lld(target) {
targetflags.push("-Clink-args=-fuse-ld=lld".to_string());
targetflags.push("-Clink-arg=-Wl,--threads=1".to_string());
}
cmd.arg("--target-rustcflags").arg(targetflags.join(" "));

Expand Down
1 change: 1 addition & 0 deletions src/test/ui/asm/sym.rs
@@ -1,4 +1,5 @@
// min-llvm-version: 10.0.1
// compile-flags: -C codegen-units=2
// only-x86_64
// only-linux
// run-pass
Expand Down
1 change: 1 addition & 0 deletions src/test/ui/issues/issue-69225-SCEVAddExpr-wrap-flag.rs
@@ -1,5 +1,6 @@
// run-fail
// compile-flags: -C opt-level=3
// min-llvm-version: 11.0
// error-pattern: index out of bounds: the len is 0 but the index is 16777216
// ignore-wasm no panic or subprocess support
// ignore-emscripten no panic or subprocess support
Expand Down
Expand Up @@ -4,6 +4,7 @@

// build-fail
// aux-build:def_colliding_external.rs
// compile-flags: -Ccodegen-units=2

extern crate def_colliding_external as dep1;

Expand Down
1 change: 1 addition & 0 deletions src/tools/compiletest/src/runtest.rs
Expand Up @@ -1952,6 +1952,7 @@ impl<'test> TestCx<'test> {
if !self.props.compile_flags.iter().any(|s| s.starts_with("--error-format")) {
rustc.args(&["--error-format", "json"]);
}
rustc.arg("-Ccodegen-units=1");
rustc.arg("-Zui-testing");
rustc.arg("-Zdeduplicate-diagnostics=no");
rustc.arg("-Zemit-future-incompat-report");
Expand Down

0 comments on commit a9dac65

Please sign in to comment.