aboutsummaryrefslogtreecommitdiff
path: root/src/zenserver/projectstore/projectstore.cpp
diff options
context:
space:
mode:
authorDan Engelbrecht <[email protected]>2023-08-21 13:09:37 +0200
committerGitHub <[email protected]>2023-08-21 13:09:37 +0200
commit21066f050050d1e7141975e70f557de91bae1a2a (patch)
tree54854a632e0a7b85f4217a5dafcb54f61480e335 /src/zenserver/projectstore/projectstore.cpp
parentuse atexit hook to shut down tracing (#369) (diff)
downloadzen-21066f050050d1e7141975e70f557de91bae1a2a.tar.xz
zen-21066f050050d1e7141975e70f557de91bae1a2a.zip
use robinmap in compact cas (#368)
* Use robin-map in compactcas for 30% faster CasContainerStrategy::CollectGarbage * use robin_set in ProjectStore::Oplog::GatherReferences and BlockStore::ReclaimSpace * changelog
Diffstat (limited to 'src/zenserver/projectstore/projectstore.cpp')
-rw-r--r--src/zenserver/projectstore/projectstore.cpp9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/zenserver/projectstore/projectstore.cpp b/src/zenserver/projectstore/projectstore.cpp
index 421a6486f..06d5221c4 100644
--- a/src/zenserver/projectstore/projectstore.cpp
+++ b/src/zenserver/projectstore/projectstore.cpp
@@ -26,6 +26,7 @@
ZEN_THIRD_PARTY_INCLUDES_START
#include <cpr/cpr.h>
+#include <tsl/robin_set.h>
#include <xxh3.h>
ZEN_THIRD_PARTY_INCLUDES_END
@@ -448,7 +449,7 @@ ProjectStore::Oplog::GatherReferences(GcContext& GcCtx)
{
ZEN_TRACE_CPU("ProjectStore::Oplog::GatherReferences");
- std::unordered_set<IoHash> AttachmentHashes;
+ tsl::robin_set<IoHash> AttachmentHashes;
IterateOplog([&](CbObject Op) {
Op.IterateAttachments([&](CbFieldView Visitor) {
IoHash Attachment = Visitor.AsAttachment();
@@ -2235,9 +2236,9 @@ ProjectStore::WriteOplog(const std::string_view ProjectId, const std::string_vie
return {HttpResponseCode::BadRequest, "Invalid payload format"};
}
- CidStore& ChunkStore = m_CidStore;
- RwLock AttachmentsLock;
- std::unordered_set<IoHash, IoHash::Hasher> Attachments;
+ CidStore& ChunkStore = m_CidStore;
+ RwLock AttachmentsLock;
+ tsl::robin_set<IoHash, IoHash::Hasher> Attachments;
auto HasAttachment = [&ChunkStore](const IoHash& RawHash) { return ChunkStore.ContainsChunk(RawHash); };
auto OnNeedBlock = [&AttachmentsLock, &Attachments](const IoHash& BlockHash, const std::vector<IoHash>&& ChunkHashes) {