aboutsummaryrefslogtreecommitdiff
path: root/src/zenstore/cache/cachedisklayer.cpp
diff options
context:
space:
mode:
authorDan Engelbrecht <[email protected]>2024-10-01 12:38:49 +0200
committerGitHub Enterprise <[email protected]>2024-10-01 12:38:49 +0200
commita032f2d84d5584a5d95e8f878cd133a5af5ab2d1 (patch)
tree7338b44aeb91423536280d4affcedb14fa9ed21e /src/zenstore/cache/cachedisklayer.cpp
parentSeparate UTF-8 flags by platform (#178) (diff)
downloadzen-a032f2d84d5584a5d95e8f878cd133a5af5ab2d1.tar.xz
zen-a032f2d84d5584a5d95e8f878cd133a5af5ab2d1.zip
optimize gc reference sort (#179)
- Do a single call to mempcy when fetching attachments from the meta store in GC - Use small lambda when calling std::sort in FilterReferences (enables inlining of the comparision function) - Use a single function for < and == comparision in KeepUnusedReferences
Diffstat (limited to 'src/zenstore/cache/cachedisklayer.cpp')
-rw-r--r--src/zenstore/cache/cachedisklayer.cpp7
1 files changed, 3 insertions, 4 deletions
diff --git a/src/zenstore/cache/cachedisklayer.cpp b/src/zenstore/cache/cachedisklayer.cpp
index b67e8a570..928165185 100644
--- a/src/zenstore/cache/cachedisklayer.cpp
+++ b/src/zenstore/cache/cachedisklayer.cpp
@@ -3586,10 +3586,9 @@ ZenCacheDiskLayer::CacheBucket::ReadAttachmentsFromMetaData(uint32_t BlockI
{
if (WantedKeys.contains(*KeyIt))
{
- for (uint32_t It = 0u; It < AttachmentCount; It++)
- {
- *OutReferencesWriteIt++ = *AttachmentReadIt++;
- }
+ memcpy(&(*OutReferencesWriteIt), &(*AttachmentReadIt), sizeof(IoHash) * AttachmentCount);
+ OutReferencesWriteIt += AttachmentCount;
+ AttachmentReadIt += AttachmentCount;
}
else
{