diff --git a/cpp/src/Private/sweepstore/benchmark.cpp b/cpp/src/Private/sweepstore/benchmark.cpp index 68eef0c..c27e66b 100644 --- a/cpp/src/Private/sweepstore/benchmark.cpp +++ b/cpp/src/Private/sweepstore/benchmark.cpp @@ -43,7 +43,7 @@ int main() { SweepstoreConcurrency::initialiseMasterAsync(filePath); - int iterations = 8; + int iterations = 16; int currentIteration = 0; int concurrencyTest = 1; @@ -120,6 +120,9 @@ int main() { std::cout << "[" << currentIteration << "/" << iterations << "] Completed " << concurrencyTest << " operations in " << duration << " ms." << std::endl; concurrencyTest *= 2; + + // Wait between iterations + preciseSleep(std::chrono::milliseconds(200)); } // Shutdown workers after all iterations diff --git a/cpp/src/Private/sweepstore/concurrency.cpp b/cpp/src/Private/sweepstore/concurrency.cpp index 05bef90..0b99479 100644 --- a/cpp/src/Private/sweepstore/concurrency.cpp +++ b/cpp/src/Private/sweepstore/concurrency.cpp @@ -161,7 +161,7 @@ void SweepstoreConcurrency::spawnTicket(SweepstoreFileHandle* _file, // Update heartbeat uint32_t currentTime = millisecondsSinceEpoch32(); - if (currentTime - snapshot.workerHeartbeat > 700) { + if (currentTime - snapshot.workerHeartbeat > STALE_HEARTBEAT_THRESHOLD_MS / 5) { snapshot.workerHeartbeat = currentTime; myTicket.write(snapshot); } diff --git a/cpp/src/Private/sweepstore/utils/fd_pool.cpp b/cpp/src/Private/sweepstore/utils/fd_pool.cpp index 636722e..b80e1ee 100644 --- a/cpp/src/Private/sweepstore/utils/fd_pool.cpp +++ b/cpp/src/Private/sweepstore/utils/fd_pool.cpp @@ -1,11 +1,5 @@ -#include "sweepstore/utils/file_lock.h" #include "sweepstore/utils/file_handle.h" -// Thread-local FD cache definition for file locking -#ifndef _WIN32 -thread_local std::unordered_map SweepstoreFileLock::fdCache; -#endif - // Thread-local stream cache definition for file handles #ifndef WITH_UNREAL thread_local std::unordered_map> SweepstoreFileHandle::streamCache; diff --git a/cpp/src/Public/sweepstore/concurrency.h b/cpp/src/Public/sweepstore/concurrency.h index f4468a9..cc40ea6 100644 --- a/cpp/src/Public/sweepstore/concurrency.h +++ b/cpp/src/Public/sweepstore/concurrency.h @@ -8,7 +8,7 @@ #include "sweepstore/utils/timing.h" -#define STALE_HEARTBEAT_THRESHOLD_MS 5000 +#define STALE_HEARTBEAT_THRESHOLD_MS 250 enum SweepstoreTicketOperation : int; class SweepstoreFileHandle;