Paper/Spigot-Server-Patches/0398-Use-more-reasonable-thread-count-default-for-bootstr.patch
Zach Brown 8ed2992da9
Make scan-for-legacy-ender-dragon config work again
Portion of diff was dropped in the mappings update commit.

Also remove the option to remove invalid statistics. The server will
automatically do this now as of... 1.13?, our option wasn't even doing anything.
2018-12-14 20:17:27 -05:00

23 lines
1.2 KiB
Diff

From 55d24fdbcaf2a193f697c2e4f7490d6fb2f0de72 Mon Sep 17 00:00:00 2001
From: Aikar <aikar@aikar.co>
Date: Tue, 23 Oct 2018 23:14:38 -0400
Subject: [PATCH] Use more reasonable thread count default for bootstrap
diff --git a/src/main/java/net/minecraft/server/DataConverterRegistry.java b/src/main/java/net/minecraft/server/DataConverterRegistry.java
index 13f237ec4..012d878cb 100644
--- a/src/main/java/net/minecraft/server/DataConverterRegistry.java
+++ b/src/main/java/net/minecraft/server/DataConverterRegistry.java
@@ -22,7 +22,7 @@ public class DataConverterRegistry {
a(datafixerbuilder);
// CraftBukkit start
- ForkJoinPool pool = new ForkJoinPool(Integer.getInteger("net.minecraft.server.DataConverterRegistry.bootstrapThreads", Math.min(Runtime.getRuntime().availableProcessors(), 2)));
+ ForkJoinPool pool = new ForkJoinPool(Integer.getInteger("net.minecraft.server.DataConverterRegistry.bootstrapThreads", Math.min(6, Math.max(Runtime.getRuntime().availableProcessors() - 2, 2)))); // Paper - use more reasonable default - 2 is hard minimum to avoid using unlimited threads
DataFixer fixer = datafixerbuilder.build(pool);
pool.shutdown();
return fixer;
--
2.20.0