Skip to content

Commit 74c3da3

Browse files
Rollup merge of #99627 - saethlin:lock-once, r=eddyb
Lock stdout once when listing tests This is a marginal optimization for normal operation, but for `cargo miri nextest list` (which is invoked by `cargo miri nextest run`) this knocks the startup time on `regex` down from 87 seconds to 17 seconds. Still slow, but a nice 5x improvement.
2 parents 90c6cde + 90dc0b0 commit 74c3da3

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Diff for: library/test/src/console.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ impl ConsoleTestState {
137137
// List the tests to console, and optionally to logfile. Filters are honored.
138138
pub fn list_tests_console(opts: &TestOpts, tests: Vec<TestDescAndFn>) -> io::Result<()> {
139139
let mut output = match term::stdout() {
140-
None => OutputLocation::Raw(io::stdout()),
140+
None => OutputLocation::Raw(io::stdout().lock()),
141141
Some(t) => OutputLocation::Pretty(t),
142142
};
143143

0 commit comments

Comments
 (0)