Paper/Spigot-Server-Patches/0391-Use-more-reasonable-thread-count-default-for-bootstr.patch
Shane Freeder 2828dd1c67 Revert "Don't update snapshot blockstates" (Fixes #1882)
CraftBukkit already checks that we're not trying to copy data
back to the same snapshot, reverting this fixes the ability to
properly update non-snapshot blockstates
2019-03-07 17:21:02 +00:00

23 lines
1.2 KiB
Diff

From 943ab46c33ccb6fd337b6f7c797163522c54404f 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 ee40bccf6..db9af361d 100644
--- a/src/main/java/net/minecraft/server/DataConverterRegistry.java
+++ b/src/main/java/net/minecraft/server/DataConverterRegistry.java
@@ -21,7 +21,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.21.0