about summary refs log tree commit diff
diff options
context:
space:
mode:
authorJoshua Nelson <github@jyn.dev>2023-03-05 07:59:36 -0600
committerJoshua Nelson <github@jyn.dev>2023-03-18 00:38:17 -0500
commit3a58b2b3b065fcb367357482f636ce918d1080bd (patch)
tree609c44e47daf8a951a5219ff2f9ad57333e38aa6
parent19b272a94b6f311affc86d721c34519299144681 (diff)
downloadrust-3a58b2b3b065fcb367357482f636ce918d1080bd.tar.gz
rust-3a58b2b3b065fcb367357482f636ce918d1080bd.zip
Let tidy use more threads
This has a significant speedup for me locally, from about 1.3 seconds to
.9 seconds.
-rw-r--r--src/bootstrap/test.rs6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/bootstrap/test.rs b/src/bootstrap/test.rs
index f5d680df113..baddc9da48d 100644
--- a/src/bootstrap/test.rs
+++ b/src/bootstrap/test.rs
@@ -1118,7 +1118,11 @@ impl Step for Tidy {
         cmd.arg(&builder.src);
         cmd.arg(&builder.initial_cargo);
         cmd.arg(&builder.out);
-        cmd.arg(builder.jobs().to_string());
+        // Tidy is heavily IO constrained. Still respect `-j`, but use a higher limit if `jobs` hasn't been configured.
+        let jobs = builder.config.jobs.unwrap_or_else(|| {
+            8 * std::thread::available_parallelism().map_or(1, std::num::NonZeroUsize::get) as u32
+        });
+        cmd.arg(jobs.to_string());
         if builder.is_verbose() {
             cmd.arg("--verbose");
         }