- added a CRC file cache to improve performance of CRC operations for large lists of files

This commit is contained in:
Mark Vejvoda
2011-03-10 21:38:43 +00:00
parent ae97a1306c
commit 330caf7f8a
5 changed files with 299 additions and 78 deletions

View File

@@ -1608,6 +1608,11 @@ int glestMain(int argc, char** argv) {
createDirectoryPaths(userData);
}
}
string crcCachePath = userData + "cache/";
if(isdir(crcCachePath.c_str()) == false) {
createDirectoryPaths(crcCachePath);
}
setCRCCacheFilePath(crcCachePath);
// Set some statics based on ini entries
SystemFlags::ENABLE_THREADED_LOGGING = config.getBool("ThreadedLogging","true");
@@ -1826,13 +1831,13 @@ int glestMain(int argc, char** argv) {
//printf("%d\n", *foo); // causes segfault
// END
if(config.getBool("AllowGameDataSynchCheck","false") == true) {
//if(config.getBool("AllowGameDataSynchCheck","false") == true) {
vector<string> techDataPaths = config.getPathListForType(ptTechs);
preCacheThread.reset(new FileCRCPreCacheThread());
preCacheThread->setUniqueID(__FILE__);
preCacheThread->setTechDataPaths(techDataPaths);
preCacheThread->start();
}
//}
// test
//Shared::Platform::MessageBox(NULL,"Mark's test.","Test",0);