[llvm-branch-commits] [llvm] [llvm][mustache] Avoid excessive hash lookups in EscapeStringStream (PR #160166)
Nikita Popov via llvm-branch-commits
llvm-branch-commits at lists.llvm.org
Tue Sep 23 00:47:57 PDT 2025
nikic wrote:
In these tests, at which point are you constructing the std::array? Is it inside each EscapeStream or once when Template is constructed?
It's possible that `std::array` wasn't the right suggestion -- maybe the fact that it stores std::string makes it too large. But if you check what find_first_of actually does https://github.com/llvm/llvm-project/blob/ebcf1bf2ecba6b25ece3c2bbddb4485e76189387/llvm/lib/Support/StringRef.cpp#L240-L242 it will just take that string of characters you pass it an convert it into a bitset. We may as well directly create the bitset instead of creating the char string and then converting it to a bit set on every call.
https://github.com/llvm/llvm-project/pull/160166
More information about the llvm-branch-commits
mailing list