[clang-tools-extra] [llvm] [Support] Remove raw_ostream::tie (PR #97396)

Alexis Engelke via cfe-commits cfe-commits at lists.llvm.org
Tue Jul 2 04:34:29 PDT 2024


aengelke wrote:

> What I feel the right initial question is, is this check actually making a significant difference to performance in real-world use cases?

raw_ostream::write shows up in my (downstream application) profiles at ~0.6%, mostly through raw_svector_ostream, which is always unbuffered. The performance improvement of this one-condition-removal is [measureable (c-t-t)](http://llvm-compile-time-tracker.com/compare.php?from=8a25bb9b391bd13d824b1df43187b4c304011cee&to=04b794a8a02f06803f96c40de042b13fd4b12c5f&stat=instructions:u).

But I see your point. I reworked this so that tie() still works, but only on raw_fd_ostream (errs() is an raw_fd_ostream), so that other streams (svector, string) get performance gains. I also updated the comment to state the motivation/use case for this feature.

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


More information about the cfe-commits mailing list