summaryrefslogtreecommitdiffstats
path: root/document
diff options
context:
space:
mode:
authorTor Egge <Tor.Egge@broadpark.no>2020-11-11 15:17:44 +0100
committerTor Egge <Tor.Egge@broadpark.no>2020-11-11 16:03:01 +0100
commit97ceb83036383d9f5f02c33a55078b8b40a748c9 (patch)
treeea5330d48ef2c328254c229858a81f68fb6bcd1f /document
parent1b7e6a0dfb0b8686aeddce7418d28bbdfd4909c1 (diff)
Add 32 most significant bits of gid key to key in btree mapping from
gid to lid in document meta store to reduce amount of CPU cache misses during lookup.
Diffstat (limited to 'document')
-rw-r--r--document/src/vespa/document/base/globalid.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/document/src/vespa/document/base/globalid.h b/document/src/vespa/document/base/globalid.h
index ac30e189033..f84ce206093 100644
--- a/document/src/vespa/document/base/globalid.h
+++ b/document/src/vespa/document/base/globalid.h
@@ -81,6 +81,10 @@ public:
value = ((value & 0x0f0f0f0f) << 4) | ((value & 0xf0f0f0f0) >> 4);
return __builtin_bswap32(value);
}
+ // Return most significant 32 bits of gid key
+ static uint32_t gid_key32(const GlobalId &gid) {
+ return bitswap(gid._gid._nums[0]);
+ }
//These 2 compare methods are exposed only for testing
static int compareRaw(unsigned char a, unsigned char b) {