8000 perf: Buffer stderr when writing json errors/warnings by Marwes · Pull Request #69227 · rust-lang/rust · GitHub
[go: up one dir, main page]

Skip to content

perf: Buffer stderr when writing json errors/warnings #69227

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Feb 29, 2020
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Ensure diagnostics are printed in the correct order
Even when buffered. Ideally we would flush only when the emitter is
done, but that requires larger changes. This gives most of the benefit
of buffering in any case.
  • Loading branch information
Markus Westerlind committed Feb 17, 2020
commit ee064befa06ad54193786c9169672f9349d0bfaf
6 changes: 4 additions & 2 deletions src/librustc_errors/json.rs
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,8 @@ impl Emitter for JsonEmitter {
writeln!(&mut self.dst, "{}", as_pretty_json(&data))
} else {
writeln!(&mut self.dst, "{}", as_json(&data))
};
}
.and_then(|_| self.dst.flush());
if let Err(e) = result {
panic!("failed to print diagnostics: {:?}", e);
}
Expand All @@ -116,7 +117,8 @@ impl Emitter for JsonEmitter {
writeln!(&mut self.dst, "{}", as_pretty_json(&data))
} else {
writeln!(&mut self.dst, "{}", as_json(&data))
};
}
.and_then(|_| self.dst.flush());
if let Err(e) = result {
panic!("failed to print notification: {:?}", e);
}
Expand Down
0