From 322a77da9e8aed76983e7f9951f23a2d1d67128e Mon Sep 17 00:00:00 2001 From: dags- Date: Sun, 14 Jun 2020 12:31:37 +0100 Subject: [PATCH] rename fields top match config key --- src/main/java/com/terraforged/chunk/TerraContext.java | 2 +- src/main/java/com/terraforged/config/ConfigManager.java | 2 +- src/main/java/com/terraforged/config/PerfDefaults.java | 6 +++--- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/main/java/com/terraforged/chunk/TerraContext.java b/src/main/java/com/terraforged/chunk/TerraContext.java index 0228940..4081004 100644 --- a/src/main/java/com/terraforged/chunk/TerraContext.java +++ b/src/main/java/com/terraforged/chunk/TerraContext.java @@ -78,7 +78,7 @@ public class TerraContext extends GeneratorContext { CommentedConfig config = PerfDefaults.getAndPrintPerfSettings(); boolean batching = config.getOrElse("batching",false); int tileSize = Math.min(PerfDefaults.MAX_TILE_SIZE, Math.max(2, config.getInt("tile_size"))); - int batchCount = Math.min(PerfDefaults.MAX_BATCH_SIZE, Math.max(1, config.getInt("batch_count"))); + int batchCount = Math.min(PerfDefaults.MAX_BATCH_COUNT, Math.max(1, config.getInt("batch_count"))); int threadCount = Math.min(PerfDefaults.MAX_THREAD_COUNT, Math.max(1, config.getInt("thread_count"))); return RegionGenerator.builder() .pool(ThreadPools.create(threadCount, batching)) diff --git a/src/main/java/com/terraforged/config/ConfigManager.java b/src/main/java/com/terraforged/config/ConfigManager.java index e4359e5..9bf013e 100644 --- a/src/main/java/com/terraforged/config/ConfigManager.java +++ b/src/main/java/com/terraforged/config/ConfigManager.java @@ -57,7 +57,7 @@ public class ConfigManager { set( cfg, "batch_count", - PerfDefaults.BATCH_SIZE, + PerfDefaults.BATCH_COUNT, "Controls the number of pieces a heightmap tile is divided up into.", "Higher batch counts may be able to utilize more of the available threads, improving performance." ); diff --git a/src/main/java/com/terraforged/config/PerfDefaults.java b/src/main/java/com/terraforged/config/PerfDefaults.java index 4c906de..7d1bb75 100644 --- a/src/main/java/com/terraforged/config/PerfDefaults.java +++ b/src/main/java/com/terraforged/config/PerfDefaults.java @@ -7,18 +7,18 @@ import com.terraforged.core.concurrent.thread.ThreadPools; public class PerfDefaults { public static final int TILE_SIZE = 3; - public static final int BATCH_SIZE = 6; + public static final int BATCH_COUNT = 6; public static final int THREAD_COUNT = ThreadPools.defaultPoolSize(); public static final int MAX_TILE_SIZE = 8; - public static final int MAX_BATCH_SIZE = 20; + public static final int MAX_BATCH_COUNT = 20; public static final int MAX_THREAD_COUNT = Runtime.getRuntime().availableProcessors(); private static boolean isUsingDefaultPerfSettings(CommentedConfig config) { boolean yes = true; yes &= config.getOrElse("batching", true); yes &= config.getInt("thread_count") == THREAD_COUNT; - yes &= config.getInt("batch_size") == BATCH_SIZE; + yes &= config.getInt("batch_size") == BATCH_COUNT; yes &= config.getInt("tile_size") == TILE_SIZE; return yes; }