mirror of
https://github.com/PaperMC/Paper.git
synced 2025-01-19 06:42:02 +01:00
Make Chunk IO Thread Base count configurable
This commit is contained in:
parent
37afe5e662
commit
d24502015a
@ -1,20 +0,0 @@
|
||||
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] Bump thread count for chunk loading
|
||||
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/chunkio/ChunkIOExecutor.java b/src/main/java/org/bukkit/craftbukkit/chunkio/ChunkIOExecutor.java
|
||||
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/chunkio/ChunkIOExecutor.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/chunkio/ChunkIOExecutor.java
|
||||
@@ -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 = 2; // Paper - Bumped value
|
||||
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);
|
||||
--
|
@ -0,0 +1,43 @@
|
||||
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
|
||||
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
||||
--- a/src/main/java/com/destroystokyo/paper/PaperConfig.java
|
||||
+++ b/src/main/java/com/destroystokyo/paper/PaperConfig.java
|
||||
@@ -0,0 +0,0 @@ public class PaperConfig {
|
||||
return config.getString(path, config.getString(path));
|
||||
}
|
||||
|
||||
+ public static int minChunkLoadThreads = 2;
|
||||
+ public static void chunkLoadThreads() {
|
||||
+ minChunkLoadThreads = Math.min(6, getInt("settings.min-chunk-load-threads", 2)); // Keep people from doing stupid things with max of 6
|
||||
+ }
|
||||
+
|
||||
public static boolean useInteractLimiter;
|
||||
private static void useInteractLimiter() {
|
||||
useInteractLimiter = getBoolean("settings.limit-player-interactions", true);
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/chunkio/ChunkIOExecutor.java b/src/main/java/org/bukkit/craftbukkit/chunkio/ChunkIOExecutor.java
|
||||
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
||||
--- 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);
|
||||
--
|
Loading…
Reference in New Issue
Block a user