diff options
author | Roman Lebedev <lebedev.ri@gmail.com> | 2019-02-25 20:51:49 +0000 |
---|---|---|
committer | Roman Lebedev <lebedev.ri@gmail.com> | 2019-02-25 20:51:49 +0000 |
commit | 0397f495c0c46a7e4ebe304e6ebf14d85fb76dc7 (patch) | |
tree | e722be2b970ad711b8a79c65b911d23f4c64b951 /llvm/lib/Object/ELFObjectFile.cpp | |
parent | 82b103998b48745ab8663d3b6ee572315dc834bf (diff) | |
download | llvm-0397f495c0c46a7e4ebe304e6ebf14d85fb76dc7.zip llvm-0397f495c0c46a7e4ebe304e6ebf14d85fb76dc7.tar.gz llvm-0397f495c0c46a7e4ebe304e6ebf14d85fb76dc7.tar.bz2 |
[Support] Make raw_string_ostream unbuffered
Summary:
In D58580 i have noted that `llvm::to_string()` is a memory hog.
It uses `raw_string_ostream`, and since it was buffered,
every `raw_string_ostream` had a cost of `BUFSIZ` bytes
(which is `8192` at least here). So every `llvm::to_string()`
call, even to just print an `int`, costed `8192` bytes.
In D58580, getting rid of that buffering //had// significant
performance and memory consumption improvements for `llvm-xray convert`.
Similarly, in D58580 @rnk pointed out that the `raw_svector_ostream`
is already unbuffered, and `write_unsigned_impl` and friends
do internal buffering. So it should be ok performance-wise to just
make the `raw_string_ostream` itself unbuffered.
Here, i don't have any perf measurements.
Another letdown is that i'm leaving a loose-end - not deleting the
`flush()` method. I don't expect that cleanup to be anything more
than just fixing every new compiler error, but i'm presently unable
to do that. Will look into that later.
Reviewers: rnk, zturner
Reviewed By: rnk
Subscribers: kristina, jdoerfert, llvm-commits, rnk
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D58643
llvm-svn: 354819
Diffstat (limited to 'llvm/lib/Object/ELFObjectFile.cpp')
0 files changed, 0 insertions, 0 deletions