Skip to content

Commit 7ac4154

Browse files
author
Markus Westerlind
committed
perf: Buffer stderr when writing json errors/warnings
Since `stderr` is unbuffered, writing out json messages actually take up about ~10%/0.1s of the runtime of the `inflate` benchmark. cc #64413
1 parent 75b98fb commit 7ac4154

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/librustc_errors/json.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ impl JsonEmitter {
4848
macro_backtrace: bool,
4949
) -> JsonEmitter {
5050
JsonEmitter {
51-
dst: Box::new(io::stderr()),
51+
dst: Box::new(io::BufWriter::new(io::stderr())),
5252
registry,
5353
sm: source_map,
5454
pretty,

0 commit comments

Comments
 (0)