Skip to content

Commit 028d222

Browse files
Switch to fully single-threaded compilation
We're still seeing a fairly large amount of variance with the current scheme; let's see if a fully single threaded build will do better. It does seem likely that we'll end up needing to abandon wall times, though, unfortunately.
1 parent 9eef993 commit 028d222

File tree

2 files changed

+3
-8
lines changed

2 files changed

+3
-8
lines changed

collector/src/bootstrap-rustc.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ use std::env;
33
use std::process::Command;
44

55
fn run() -> i32 {
6-
let server = Client::new(num_cpus::get_physical() / 3).expect("made jobserver");
6+
let server = Client::new(1).expect("made jobserver");
77

88
let mut cmd = Command::new(env::var_os("RUSTC_PERF_REAL_RUSTC").unwrap());
99
cmd.args(env::args_os().skip(1));

collector/src/execute/rustc.rs

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,6 @@ pub fn measure(
2424
) -> anyhow::Result<()> {
2525
checkout(&artifact).context("checking out rust-lang/rust")?;
2626

27-
// Run the compiler multiple times -- we'll call min(duration) on each crate
28-
// later on. This should (hopefully) reduce variance.
29-
record(rt, conn, compiler, artifact, aid)?;
30-
record(rt, conn, compiler, artifact, aid)?;
3127
record(rt, conn, compiler, artifact, aid)?;
3228

3329
Ok(())
@@ -99,9 +95,8 @@ fn record(
9995
.arg("0")
10096
// We want bootstrap and the Cargos it spawns to have no parallelism --
10197
// if multiple rustcs are competing for jobserver tokens, we introduce
102-
// quite a bit of variance. Instead, we configure -j3 here, and then
103-
// 1/3 all vCPU parallelism for each rustc.
104-
.arg("-j3")
98+
// quite a bit of variance.
99+
.arg("-j1")
105100
.arg("compiler/rustc"),
106101
)
107102
.context("building rustc")?;

0 commit comments

Comments
 (0)