From 8688ea955e57a3063b2e145e7ccf8c9ffb182869 Mon Sep 17 00:00:00 2001 From: Mark Vejvoda Date: Sun, 26 Dec 2010 02:15:56 +0000 Subject: [PATCH] - trying to tweak threaded logger performance when log entries are in the hundreds of thousands --- .../shared_lib/sources/platform/common/simple_threads.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/source/shared_lib/sources/platform/common/simple_threads.cpp b/source/shared_lib/sources/platform/common/simple_threads.cpp index b8a10af8..1f05b3b3 100644 --- a/source/shared_lib/sources/platform/common/simple_threads.cpp +++ b/source/shared_lib/sources/platform/common/simple_threads.cpp @@ -207,15 +207,15 @@ void LogFileThread::addLogEntry(SystemFlags::DebugType type, string logEntry) { entry.entryDateTime = time(NULL); logList.push_back(entry); - if(logList.size() >= 100000) { + if(logList.size() >= 750000) { saveToDisk(false,true); } } bool LogFileThread::checkSaveCurrentLogBufferToDisk() { bool ret = false; - if(difftime(time(NULL),lastSaveToDisk) >= 5 || - LogFileThread::getLogEntryBufferCount() >= 100000) { + if(difftime(time(NULL),lastSaveToDisk) >= 10 || + LogFileThread::getLogEntryBufferCount() >= 500000) { lastSaveToDisk = time(NULL); ret = true; } @@ -280,7 +280,7 @@ void LogFileThread::saveToDisk(bool forceSaveAll,bool logListAlreadyLocked) { //logCount = tempLogList.size(); if(forceSaveAll == false) { - logCount = min(logCount,(std::size_t)250000); + logCount = min(logCount,(std::size_t)1000000); } for(int i = 0; i < logCount; ++i) {