From ec1c1cf43f362ab738292abae5f88de5ce3e5c81 Mon Sep 17 00:00:00 2001 From: Andrew Noyes Date: Thu, 31 Oct 2024 15:35:00 -0700 Subject: [PATCH] Run gc less frequently But still run it to account for the version potentially increasing --- ConflictSet.cpp | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/ConflictSet.cpp b/ConflictSet.cpp index 76e9503..63d08d2 100644 --- a/ConflictSet.cpp +++ b/ConflictSet.cpp @@ -5128,9 +5128,6 @@ struct __attribute__((visibility("hidden"))) ConflictSet::Impl { assert(writeContext.accum.entries_erased == 0); assert(writeContext.accum.entries_inserted == 0); - // Queue up some gc work just for (potentially) increasing the version - ++keyUpdates; - if (oldestExtantVersion < writeVersion - kMaxCorrectVersionWindow) [[unlikely]] { if (writeVersion > newestVersionFullPrecision + kNominalVersionWindow) { @@ -5187,10 +5184,11 @@ struct __attribute__((visibility("hidden"))) ConflictSet::Impl { writeContext.releaseDeferred(); - // Run gc at least 200% the rate we're inserting entries + // Run gc at least 200% the rate we're inserting entries, and at least run + // some gc just for potentially increasing the version. keyUpdates += std::max(writeContext.accum.entries_inserted - writeContext.accum.entries_erased, - 0) * + 1) * 2; point_writes_total.add(writeContext.accum.point_writes);