logic: sort and shuffle indexer commands for performance

Before indexing the indexer commands are sorted according to byte size of the
indexed source file. Afterwards the list is split into two halves and each half
is shuffled. This ensures that bigger files tend to be indexed first, so that
no indexer thread runs idle at the end of indexing.
This commit is contained in:
malte_langkabel
2017-08-02 12:03:53 +02:00
parent 2c6322631b
commit 91969770d5
3 changed files with 31 additions and 2 deletions
+5
View File
@@ -138,6 +138,11 @@ std::vector<FileInfo> FileSystem::getFileInfosFromPaths(
return files;
}
unsigned long long FileSystem::getFileByteSize(const FilePath& filePath)
{
return boost::filesystem::file_size(filePath.path());
}
TimePoint FileSystem::getLastWriteTime(const FilePath& filePath)
{
boost::posix_time::ptime lastWriteTime;