mirror of
https://github.com/rust-lang/rust.git
synced 2025-04-28 02:57:37 +00:00
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.
This commit is contained in:
commit
74c3da39f0
@ -137,7 +137,7 @@ impl ConsoleTestState {
|
||||
// List the tests to console, and optionally to logfile. Filters are honored.
|
||||
pub fn list_tests_console(opts: &TestOpts, tests: Vec<TestDescAndFn>) -> io::Result<()> {
|
||||
let mut output = match term::stdout() {
|
||||
None => OutputLocation::Raw(io::stdout()),
|
||||
None => OutputLocation::Raw(io::stdout().lock()),
|
||||
Some(t) => OutputLocation::Pretty(t),
|
||||
};
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user