Increase benchmark iterations and adjust heartbeat threshold for improved timing accuracy

This commit is contained in:
ImBenji
2025-12-11 18:05:08 +00:00
parent 0836935888
commit c97f36cfb6
4 changed files with 6 additions and 9 deletions

View File

@@ -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

View File

@@ -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);
}

View File

@@ -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<std::string, int> SweepstoreFileLock::fdCache;
#endif
// Thread-local stream cache definition for file handles
#ifndef WITH_UNREAL
thread_local std::unordered_map<std::string, std::unique_ptr<std::fstream>> SweepstoreFileHandle::streamCache;

View File

@@ -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;