diff options
Diffstat (limited to 'src/zenserver/projectstore/projectstore.cpp')
| -rw-r--r-- | src/zenserver/projectstore/projectstore.cpp | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/src/zenserver/projectstore/projectstore.cpp b/src/zenserver/projectstore/projectstore.cpp index e000976ea..02760f6dd 100644 --- a/src/zenserver/projectstore/projectstore.cpp +++ b/src/zenserver/projectstore/projectstore.cpp @@ -507,14 +507,17 @@ ProjectStore::Oplog::GatherReferences(GcContext& GcCtx) return; } - tsl::robin_set<IoHash> AttachmentHashes; + std::vector<IoHash> Cids; + Cids.reserve(1024); IterateOplog([&](CbObject Op) { - Op.IterateAttachments([&](CbFieldView Visitor) { - IoHash Attachment = Visitor.AsAttachment(); - AttachmentHashes.insert(Attachment); - }); + Op.IterateAttachments([&](CbFieldView Visitor) { Cids.emplace_back(Visitor.AsAttachment()); }); + if (Cids.size() >= 1024) + { + GcCtx.AddRetainedCids(Cids); + Cids.clear(); + } }); - GcCtx.AddRetainedCids(std::vector<IoHash>(AttachmentHashes.begin(), AttachmentHashes.end())); + GcCtx.AddRetainedCids(Cids); } uint64_t |