Isn't stdout line buffered by default?


On Wed, Feb 19, 2014 at 7:39 PM, Huon Wilson <notifications@github.com>wrote:

> In src/librustc/driver/driver.rs:
>
> > @@ -220,8 +231,16 @@ pub fn phase_2_configure_and_expand(sess: Session,
> >      krate = time(time_passes, "prelude injection", krate, |krate|
> >                   front::std_inject::maybe_inject_prelude(sess, krate));
> >
> > -    time(time_passes, "assinging node ids and indexing ast", krate, |krate|
> > -         front::assign_node_ids_and_map::assign_node_ids_and_map(sess, krate))
> > +    let (krate, map) = time(time_passes, "assinging node ids and indexing ast", krate, |krate|
> > +         front::assign_node_ids_and_map::assign_node_ids_and_map(sess, krate));
> > +
> > +    if sess.opts.debugging_opts & session::AST_JSON != 0 {
> > +        let mut stdout = io::stdout();
>
> Shouldn't this be buffered? (Otherwise every single write, including each
> and every : separator will be a syscall.)
>
> —
> Reply to this email directly or view it on GitHub<https://github.com/mozilla/rust/pull/12387/files#r9890950>
> .
>