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:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user