[llvm] [llvm-strings] Use small buffer instead of reading whole file (PR #163073)
via llvm-commits
llvm-commits at lists.llvm.org
Sun Sep 13 13:37:23 PDT 2026
aokblast wrote:
> This may be an improvement for when the input is a pipe, but the current implementation uses `mmap` where possible and if I'm looking at this PR right, your replacement never does, so I would expect it to impact performance for that case. Can you either run measurements and show that this case is not significantly affected, or change the PR to continue first trying to use `mmap`, only falling back to processing the input in chunks if `mmap` fails?
For some reason, we don't use mmap even in normal cases. See: https://github.com/llvm/llvm-project/pull/162013. I provides a performance benchmark on that patch, which shows that there is no perforamce improvement before and after.
>
> It'll need a bit of thinking on how this interacts with #221794 when a multibyte character spans multiple chunks. `std::codecvt_base::result` does not distinguish between the case where the source buffer ends unexpectedly and the case where the target buffer is not large enough, but these will require different treatment. I'll have a think but I'd welcome your thoughts on that as well.
https://github.com/llvm/llvm-project/pull/163073
More information about the llvm-commits
mailing list