[Lldb-commits] [PATCH] D122974: prevent ConstString from calling djbHash() more than once

Greg Clayton via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Fri Apr 29 11:37:05 PDT 2022

clayborg added a comment.

In D122974#3482720 <https://reviews.llvm.org/D122974#3482720>, @llunak wrote:

> In D122974#3482556 <https://reviews.llvm.org/D122974#3482556>, @labath wrote:
>> Interesting. I don't know if I missed this somewhere, but could explain what kind of a map operation can lldb perform without computing the hash at least once?
> All of them :). Computing is not the only way of obtaining the hash of a string. LLDB index cache (settings set symbols.enable-lldb-index-cache true) stores a big bunch of strings and when loading them back into ConstString the next time djbHash() is ~15% of total CPU LLDB startup time. That could be saved if the cache cached the hash values too.

If the string pool caches the hash value, we could actually write out the hash in the cache file to speed up loading. I didn't want to re-hash every string when I saved the strings out to the cache file due to the cost, but it would be interesting to look into to see if it improves performance.

  rG LLVM Github Monorepo



More information about the lldb-commits mailing list