[PATCH] D45793: [XRay][compiler-rt] - Dedupe xray event type strings from different addresses.
Dean Michael Berris via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Thu Apr 19 18:49:20 PDT 2018
dberris added inline comments.
================
Comment at: lib/xray/xray_unique_string_table.cc:38
+// even though the intended use cases are not high cardinality.
+uint32_t Murmur3_32(const char *key, std::size_t length) {
+ static constexpr uint32_t seed = 0x31415926;
----------------
kpw wrote:
> dberris wrote:
> > Do we not have this yet in the sanitizer_common/... library? And do we actually need this?
> 1. I saw a murmur 2 implementation, but it was part of an implementation file.
> 2. I started out wanting to build a hashmap without resizing. Essentially it would grow up until a load factor with something layers like BlockLink. Collision would cause array-wrapped lookahead, and it grows by adding more layers. You can find a value in lookups ~= to the number of Block layers, and it would never have to resize. I decided this patch was "good enough" though.
We should be able to hoist out the existing implementation into a header in sanitizer_common/ if it's already in the sanitizer implementation(s). We can either do that in this change, or in a separate one which this will depend on.
I agree that for the purposes of implementing an efficient string intern table which only really gets looked up very infrequently (i.e. using registration of types) then we shouldn't be over-thinking this data structure/implementation for now.
Repository:
rCRT Compiler Runtime
https://reviews.llvm.org/D45793
More information about the llvm-commits
mailing list