From f7a3604d412bdd57e5fb7981cd3788edc1cd9b75 Mon Sep 17 00:00:00 2001 From: Reinhard Pointner Date: Thu, 6 Nov 2014 05:00:08 +0000 Subject: [PATCH] * will be mostly IO bound so make sure thread count doesn't easily get higher than 8-12 threads --- source/net/filebot/ui/sfv/ChecksumComputationService.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/net/filebot/ui/sfv/ChecksumComputationService.java b/source/net/filebot/ui/sfv/ChecksumComputationService.java index 6e450e9d..9ade7b74 100644 --- a/source/net/filebot/ui/sfv/ChecksumComputationService.java +++ b/source/net/filebot/ui/sfv/ChecksumComputationService.java @@ -103,7 +103,7 @@ class ChecksumComputationService { // for a few files, use one thread // 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 - return max(1, (int) ((threadPoolSize / 2) + log10(getQueue().size()) - 1)); + return (int) max(1, round(sqrt(threadPoolSize) + log10(getQueue().size()) - 1)); } @Override