* will be mostly IO bound so make sure thread count doesn't easily get higher than 8-12 threads

This commit is contained in:
Reinhard Pointner 2014-11-06 05:00:08 +00:00
parent ef4df09197
commit f7a3604d41
1 changed files with 1 additions and 1 deletions

View File

@ -103,7 +103,7 @@ class ChecksumComputationService {
// for a few files, use one thread // for a few files, use one thread
// for lots of files, use multiple threads // for lots of files, use multiple threads
// e.g 50 files ~ 1 thread, 200 files ~ 2 threads, 1000 files ~ 3 threads, 40000 files ~ 5 threads // e.g 50 files ~ 1 thread, 200 files ~ 2 threads, 1000 files ~ 3 threads, 40000 files ~ 5 threads
return max(1, (int) ((threadPoolSize / 2) + log10(getQueue().size()) - 1)); return (int) max(1, round(sqrt(threadPoolSize) + log10(getQueue().size()) - 1));
} }
@Override @Override