From c8226b83ee512fc000dd9d00dee67884fbb59ccf Mon Sep 17 00:00:00 2001 From: Michael Bayne Date: Fri, 30 Nov 2018 11:41:59 -0800 Subject: [PATCH] Default concurrent download count to #CPUS-1. --- CHANGELOG.md | 3 +++ .../src/main/java/com/threerings/getdown/data/Application.java | 3 ++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 38f2dec..772d905 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,9 @@ * When a custom JVM is installed, old JVM files will be deleted prior to unpacking the new JVM. Via PR#170. +* Number of concurrent downloads now defaults to num-cores minus one. Though downloads are I/O + bound rather than CPU bound, this still turns out to be a decent default. + ## 1.8.2 - Nov 27, 2018 * Fixed a data corruption bug introduced at last minute into 1.8.1 release. Oops. diff --git a/core/src/main/java/com/threerings/getdown/data/Application.java b/core/src/main/java/com/threerings/getdown/data/Application.java index 3719d45..18db36d 100644 --- a/core/src/main/java/com/threerings/getdown/data/Application.java +++ b/core/src/main/java/com/threerings/getdown/data/Application.java @@ -717,7 +717,8 @@ public class Application _codeCacheRetentionDays = config.getInt("code_cache_retention_days", 7); // maximum simultaneous downloads - _maxConcDownloads = Math.max(1, config.getInt("max_concurrent_downloads", 2)); + _maxConcDownloads = Math.max(1, config.getInt("max_concurrent_downloads", + SysProps.threadPoolSize())); // parse and return our application config UpdateInterface ui = new UpdateInterface(config);