JDevlieghere added a comment.

The ConstString/StringPool is pretty hot so I'm very excited about making it 
faster.

I'm slightly concerned about the two hash values (the "full" hash vs the single 
byte one). That's not something that was introduced in this patch, but passing 
it around adds an opportunity to get it wrong.

I'm wondering if we could wrap this in a struct and pass that around:

  struct HashedStringRef {
    const llvm::StringRef str;
    const unsigned full_hash;
    const uint8_t hash; 
    HashedStringRef(llvm::StringRef s) : str(s), full_hash(djbHash(str)), 
hash(hash(str)) {}
  }

It looks like we always need both except in the StringMap implementation, but 
if I'm reading the code correctly we'll have constructed it in ConstString 
already anyway?


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D122974/new/

https://reviews.llvm.org/D122974

_______________________________________________
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

Reply via email to