From 93b57ae2e1d768bea880df0e2c1e6b149cc900ff Mon Sep 17 00:00:00 2001 From: s809 <43530948+s809@users.noreply.github.com> Date: Tue, 30 Jul 2024 10:52:27 +0500 Subject: [PATCH] Increase defaults for network compression threads --- .../presets/ThreadPresetConfigEventHandler.java | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/core/src/main/java/com/seibel/distanthorizons/core/config/eventHandlers/presets/ThreadPresetConfigEventHandler.java b/core/src/main/java/com/seibel/distanthorizons/core/config/eventHandlers/presets/ThreadPresetConfigEventHandler.java index bcdbb45c9..08542169c 100644 --- a/core/src/main/java/com/seibel/distanthorizons/core/config/eventHandlers/presets/ThreadPresetConfigEventHandler.java +++ b/core/src/main/java/com/seibel/distanthorizons/core/config/eventHandlers/presets/ThreadPresetConfigEventHandler.java @@ -32,6 +32,7 @@ import java.util.Arrays; import java.util.HashMap; import java.util.List; +@SuppressWarnings("FieldCanBeLocal") public class ThreadPresetConfigEventHandler extends AbstractPresetConfigEventHandler { public static final ThreadPresetConfigEventHandler INSTANCE = new ThreadPresetConfigEventHandler(); @@ -128,24 +129,24 @@ public class ThreadPresetConfigEventHandler extends AbstractPresetConfigEventHan }}); - public static int getNetworkCompressionDefaultThreadCount() { return getThreadCountByPercent(0.1); } + public static int getNetworkCompressionDefaultThreadCount() { return getThreadCountByPercent(0.3); } private final ConfigEntryWithPresetOptions networkCompressionThreadCount = new ConfigEntryWithPresetOptions<>(Config.Client.Advanced.MultiThreading.numberOfNetworkCompressionThreads, new HashMap() {{ this.put(EDhApiThreadPreset.MINIMAL_IMPACT, 1); this.put(EDhApiThreadPreset.LOW_IMPACT, getNetworkCompressionDefaultThreadCount()); - this.put(EDhApiThreadPreset.BALANCED, getThreadCountByPercent(0.2)); - this.put(EDhApiThreadPreset.AGGRESSIVE, getThreadCountByPercent(0.4)); - this.put(EDhApiThreadPreset.I_PAID_FOR_THE_WHOLE_CPU, getThreadCountByPercent(0.6)); + this.put(EDhApiThreadPreset.BALANCED, getThreadCountByPercent(0.4)); + this.put(EDhApiThreadPreset.AGGRESSIVE, getThreadCountByPercent(0.6)); + this.put(EDhApiThreadPreset.I_PAID_FOR_THE_WHOLE_CPU, getThreadCountByPercent(0.8)); }}); - public static double getNetworkCompressionDefaultRunTimeRatio() { return 0.25; } + public static double getNetworkCompressionDefaultRunTimeRatio() { return 0.5; } private final ConfigEntryWithPresetOptions networkCompressionRunTime = new ConfigEntryWithPresetOptions<>(Config.Client.Advanced.MultiThreading.runTimeRatioForNetworkCompressionThreads, new HashMap() {{ - this.put(EDhApiThreadPreset.MINIMAL_IMPACT, 0.1); + this.put(EDhApiThreadPreset.MINIMAL_IMPACT, 0.25); this.put(EDhApiThreadPreset.LOW_IMPACT, getNetworkCompressionDefaultRunTimeRatio()); - this.put(EDhApiThreadPreset.BALANCED, 0.5); - this.put(EDhApiThreadPreset.AGGRESSIVE, 0.75); + this.put(EDhApiThreadPreset.BALANCED, 0.75); + this.put(EDhApiThreadPreset.AGGRESSIVE, 1.0); this.put(EDhApiThreadPreset.I_PAID_FOR_THE_WHOLE_CPU, 1.0); }});