[llvm-commits] [llvm] r78924 - in /llvm/trunk: include/llvm/Support/raw_ostream.h lib/Support/raw_ostream.cpp

Chris Lattner clattner at apple.com
Thu Aug 13 17:20:42 PDT 2009


On Aug 13, 2009, at 10:55 AM, Daniel Dunbar wrote:

> On Thu, Aug 13, 2009 at 10:41 AM, Dan Gohman<gohman at apple.com> wrote:
>> Author: djg
>> Date: Thu Aug 13 12:41:40 2009
>> New Revision: 78924
>>
>> URL: http://llvm.org/viewvc/llvm-project?rev=78924&view=rev
>> Log:
>> Set raw_os_ostream, raw_string_ostream, and raw_svector_ostream to be
>> unbuffered. std::ostream does its own buffering, and std::string and
>> SmallVector both have allocation strategies intended to handle  
>> frequent
>> appending.
>
>
> Eek!
>
> Did you profile the effects of this change? I expect that this
> dramatically slows down these streams. One of the main values of being
> buffered in raw_ostream is that we hit all the fast paths to quickly
> output small strings. Making all of these strings unbuffered nullifies
> several of these optimizations.

Yes, I'm really scared of this too.  The whole idea of raw_ostream is  
to inline the trivial "o << 'c'" calls.  This doesn't help if the  
inlined code is always calling flush!

-Chris




More information about the llvm-commits mailing list