aboutsummaryrefslogtreecommitdiff
path: root/src/zencore/include
diff options
context:
space:
mode:
authorDan Engelbrecht <[email protected]>2024-09-17 15:05:40 +0200
committerGitHub Enterprise <[email protected]>2024-09-17 15:05:40 +0200
commitd020b6522b2d962db67f8a66410e74d61cf3da24 (patch)
tree44985edb66e5405df2d3a57c291490b2a0485337 /src/zencore/include
parentRunning the public github release mirroring as part of creating the release (... (diff)
downloadzen-d020b6522b2d962db67f8a66410e74d61cf3da24.tar.xz
zen-d020b6522b2d962db67f8a66410e74d61cf3da24.zip
gc performance improvements (#160)
* optimized ValidateCbUInt * optimized iohash comparision * replace unordered set/map with tsl/robin set/map in blockstore * increase max buffer size when writing cache bucket sidecar * only store meta data for files < 4Gb * faster ReadAttachmentsFromMetaData * remove memcpy call in BlockStoreDiskLocation * only write cache bucket state to disk if GC deleted anything
Diffstat (limited to 'src/zencore/include')
-rw-r--r--src/zencore/include/zencore/iohash.h15
1 files changed, 14 insertions, 1 deletions
diff --git a/src/zencore/include/zencore/iohash.h b/src/zencore/include/zencore/iohash.h
index c70e98e47..ff902399e 100644
--- a/src/zencore/include/zencore/iohash.h
+++ b/src/zencore/include/zencore/iohash.h
@@ -61,7 +61,20 @@ struct IoHash
static const IoHash Zero; // Initialized to all zeros
inline auto operator<=>(const IoHash& rhs) const = default;
- inline bool operator==(const IoHash& rhs) const { return memcmp(Hash, rhs.Hash, sizeof Hash) == 0; }
+ inline bool operator==(const IoHash& rhs) const
+ {
+ const uint32_t* LhsHash = reinterpret_cast<const uint32_t*>(Hash);
+ const uint32_t* RhsHash = reinterpret_cast<const uint32_t*>(rhs.Hash);
+ return LhsHash[0] == RhsHash[0] && LhsHash[1] == RhsHash[1] && LhsHash[2] == RhsHash[2] && LhsHash[3] == RhsHash[3] &&
+ LhsHash[4] == RhsHash[4];
+ }
+ inline bool operator!=(const IoHash& rhs) const
+ {
+ const uint32_t* LhsHash = reinterpret_cast<const uint32_t*>(Hash);
+ const uint32_t* RhsHash = reinterpret_cast<const uint32_t*>(rhs.Hash);
+ return LhsHash[0] != RhsHash[0] || LhsHash[1] != RhsHash[1] || LhsHash[2] != RhsHash[2] || LhsHash[3] != RhsHash[3] ||
+ LhsHash[4] != RhsHash[4];
+ }
inline bool operator<(const IoHash& rhs) const { return memcmp(Hash, rhs.Hash, sizeof Hash) < 0; }
struct Hasher