2016-03-22 04:51:58 +01:00
|
|
|
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
|
|
From: Zach Brown <1254957+zachbr@users.noreply.github.com>
|
|
|
|
Date: Wed, 2 Mar 2016 23:46:57 -0600
|
|
|
|
Subject: [PATCH] Configurable Chunk IO Thread Base Count
|
|
|
|
|
|
|
|
|
|
|
|
diff --git a/src/main/java/com/destroystokyo/paper/PaperConfig.java b/src/main/java/com/destroystokyo/paper/PaperConfig.java
|
2017-04-22 08:16:45 +02:00
|
|
|
index 007589314..9a6f87e59 100644
|
2016-03-22 04:51:58 +01:00
|
|
|
--- a/src/main/java/com/destroystokyo/paper/PaperConfig.java
|
|
|
|
+++ b/src/main/java/com/destroystokyo/paper/PaperConfig.java
|
2016-03-25 05:59:37 +01:00
|
|
|
@@ -0,0 +0,0 @@ public class PaperConfig {
|
2016-09-11 04:42:47 +02:00
|
|
|
" - Interval: " + timeSummary(Timings.getHistoryInterval() / 20) +
|
|
|
|
" - Length: " + timeSummary(Timings.getHistoryLength() / 20));
|
2016-03-25 05:59:37 +01:00
|
|
|
}
|
|
|
|
+
|
2016-03-22 04:51:58 +01:00
|
|
|
+ public static int minChunkLoadThreads = 2;
|
2016-06-05 00:26:11 +02:00
|
|
|
+ private static void chunkLoadThreads() {
|
2016-03-22 04:51:58 +01:00
|
|
|
+ minChunkLoadThreads = Math.min(6, getInt("settings.min-chunk-load-threads", 2)); // Keep people from doing stupid things with max of 6
|
|
|
|
+ }
|
2016-03-25 05:59:37 +01:00
|
|
|
}
|
2016-03-22 04:51:58 +01:00
|
|
|
diff --git a/src/main/java/org/bukkit/craftbukkit/chunkio/ChunkIOExecutor.java b/src/main/java/org/bukkit/craftbukkit/chunkio/ChunkIOExecutor.java
|
2017-03-25 04:18:58 +01:00
|
|
|
index e4fd9bc60..7b7a3d01b 100644
|
2016-03-22 04:51:58 +01:00
|
|
|
--- a/src/main/java/org/bukkit/craftbukkit/chunkio/ChunkIOExecutor.java
|
|
|
|
+++ b/src/main/java/org/bukkit/craftbukkit/chunkio/ChunkIOExecutor.java
|
|
|
|
@@ -0,0 +0,0 @@
|
|
|
|
package org.bukkit.craftbukkit.chunkio;
|
|
|
|
|
|
|
|
+import com.destroystokyo.paper.PaperConfig;
|
|
|
|
import net.minecraft.server.Chunk;
|
|
|
|
import net.minecraft.server.ChunkProviderServer;
|
|
|
|
import net.minecraft.server.ChunkRegionLoader;
|
|
|
|
@@ -0,0 +0,0 @@ import net.minecraft.server.World;
|
|
|
|
import org.bukkit.craftbukkit.util.AsynchronousExecutor;
|
|
|
|
|
|
|
|
public class ChunkIOExecutor {
|
|
|
|
- static final int BASE_THREADS = 1;
|
|
|
|
+ static final int BASE_THREADS = PaperConfig.minChunkLoadThreads; // Paper
|
|
|
|
static final int PLAYERS_PER_THREAD = 50;
|
|
|
|
|
|
|
|
private static final AsynchronousExecutor<QueuedChunk, Chunk, Runnable, RuntimeException> instance = new AsynchronousExecutor<QueuedChunk, Chunk, Runnable, RuntimeException>(new ChunkIOProvider(), BASE_THREADS);
|
|
|
|
--
|