[PATCH] Disable buffering for raw_null_ostream()

Rafael EspĂ­ndola rafael.espindola at gmail.com
Thu Jul 2 06:23:08 PDT 2015


On 1 July 2015 at 01:40, Mehdi AMINI <mehdi.amini at apple.com> wrote:
> Hi rafael,
>
> There is no need to buffer the nulls() output.

There is performance. The idea of nulls() is that it is a very fast
way to discard data. Making it unbuffered adds a virtual call to every
write.

> Moreover it kept a shared buffer, and made using nulls() not possible
> in a multi-threaded environment.

Sorry, I really don't see it. By reading the code it looks like we
will call SetBuffered,  which will call  SetBufferSize(Size), which
will allocate a new buffer.

Cheers,
Rafael



More information about the llvm-commits mailing list