[PATCH] D64969: [llvm-objdump][NFC] Make the PrettyPrinter::printInst() output buffered

Seiya Nuta via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sun Jul 21 23:13:10 PDT 2019


seiya added a comment.

In D64969#1595098 <https://reviews.llvm.org/D64969#1595098>, @MaskRay wrote:

> Nice finding!
>
> > [1]: https://github.com/llvm/llvm-project/blob/2946cd701067404b99c39fb29dc9c74bd7193eb3/llvm/include/llvm/Support/FormattedStream.h#L83
>
> I think the 4x (line buffered vs unbuffered) slowdown can be explained by your first link. The formatted_raw_ostream ctor resets the underlying stream (`outs()`) to unbuffered. There are several solutions to the problem. Given `formatted_raw_ostream FOS(OS);` is only used once in PrettyPrinter and can be easily replaced, I suggest deleting it and tracking the column manually.


Tracking the column manually sounds good idea to me. I'll try that!


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D64969/new/

https://reviews.llvm.org/D64969





More information about the llvm-commits mailing list