Skip to content

Commit 8d2ef19

Browse files
authored
Rollup merge of #64344 - eddyb:mir-opt-stop-shouting-at-the-kernel, r=oli-obk
rustc_mir: buffer -Zdump-mir output instead of pestering the kernel constantly. This brings `mir-opt` tests from `197s` (over 3 minutes!) to `2.85s`, on my build server. That's a nice speedup of about `69x` and so it definitely fixes #58485, for me. It's such a beginner mistake I feel like maybe `clippy` should lint against it? (cc @Manishearth @oli-obk)
2 parents 26a4af9 + 1e7faef commit 8d2ef19

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/librustc_mir/util/pretty.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -227,12 +227,12 @@ pub(crate) fn create_dump_file(
227227
pass_name: &str,
228228
disambiguator: &dyn Display,
229229
source: MirSource<'tcx>,
230-
) -> io::Result<fs::File> {
230+
) -> io::Result<io::BufWriter<fs::File>> {
231231
let file_path = dump_path(tcx, extension, pass_num, pass_name, disambiguator, source);
232232
if let Some(parent) = file_path.parent() {
233233
fs::create_dir_all(parent)?;
234234
}
235-
fs::File::create(&file_path)
235+
Ok(io::BufWriter::new(fs::File::create(&file_path)?))
236236
}
237237

238238
/// Write out a human-readable textual representation for the given MIR.

0 commit comments

Comments
 (0)