2020-05-06 09:48:49 +00:00
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
2018-10-24 03:53:13 +00:00
From: Aikar <aikar@aikar.co>
Date: Tue, 23 Oct 2018 23:14:38 -0400
Subject: [PATCH] Use more reasonable thread count default for bootstrap
2019-05-05 11:12:32 +00:00
diff --git a/src/main/java/net/minecraft/server/SystemUtils.java b/src/main/java/net/minecraft/server/SystemUtils.java
2020-05-19 08:01:53 +00:00
index 7e224ebeff3bf34270df173a47b08d3290c00670..60d7c06d4c5bd054a411c915af3ae685df24ccd4 100644
2019-05-05 11:12:32 +00:00
--- a/src/main/java/net/minecraft/server/SystemUtils.java
+++ b/src/main/java/net/minecraft/server/SystemUtils.java
2020-05-19 08:01:53 +00:00
@@ -66,7 +66,8 @@ public class SystemUtils {
2019-05-05 11:12:32 +00:00
}
2018-10-24 03:53:13 +00:00
2019-05-05 11:12:32 +00:00
private static ExecutorService k() {
- int i = MathHelper.clamp(Runtime.getRuntime().availableProcessors() - 1, 1, 7);
2020-05-19 08:01:53 +00:00
+ int i = Math.min(8, Math.max(Runtime.getRuntime().availableProcessors() - 2, 3)); // Paper - use more reasonable default - 2 is hard minimum to avoid using unlimited threads
+ i = Integer.getInteger("Paper.WorkerThreadCount", i); // Paper - allow overriding
2019-05-05 11:12:32 +00:00
Object object;
if (i <= 0) {