[llvm] [llvm] Don't flush llvm::raw_string_ostream (NFC) (PR #110754)

Alexis Engelke via llvm-commits llvm-commits at lists.llvm.org
Wed Oct 2 02:53:35 PDT 2024


aengelke wrote:

The problem with raw_svector_ostream/raw_string_ostream being unbuffered is that all writes go through the slow path of raw_ostream, which adds quite a bit of overhead (every write is a virtual function call). In #97704, we kind of settled on not changing the buffering behavior of the existing classes, but instead introduce new, buffered classes that are more performant. This means replacing uses of the raw_{string,svector}_ostream with buffered equivalent that needs flushing.

I therefore don't object this change. However, I'd personally rather like to see the performance problem addressed. (Unfortunately, I'm rather busy with $dayjob right now and won't have time to work on this myself before the end of the year.)

https://github.com/llvm/llvm-project/pull/110754


More information about the llvm-commits mailing list