From f827e93edfe274eb4c4b04da5768bbec3193415e Mon Sep 17 00:00:00 2001
From: Aikar <aikar@aikar.co>
Date: Tue, 23 Oct 2018 23:53:13 -0400
Subject: [PATCH] Improve default thread counts for DataFix BootStrap

Spigot capped it to 2 threads. This bumps it back up to do
maxcores -2 with a max cap of 6.

A typical 4C8T system can use 6 threads and be done in 6 seconds.

Server owners can use system property to override, but this
improves the default.
---
 ...ble-thread-count-default-for-bootstr.patch | 20 +++++++++++++++++++
 1 file changed, 20 insertions(+)
 create mode 100644 Spigot-Server-Patches/Use-more-reasonable-thread-count-default-for-bootstr.patch

diff --git a/Spigot-Server-Patches/Use-more-reasonable-thread-count-default-for-bootstr.patch b/Spigot-Server-Patches/Use-more-reasonable-thread-count-default-for-bootstr.patch
new file mode 100644
index 0000000000..8908dc9a1d
--- /dev/null
+++ b/Spigot-Server-Patches/Use-more-reasonable-thread-count-default-for-bootstr.patch
@@ -0,0 +1,20 @@
+From 0000000000000000000000000000000000000000 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 7ac07ac07ac0..7ac07ac07ac0 100644
+--- a/src/main/java/net/minecraft/server/DataConverterRegistry.java
++++ b/src/main/java/net/minecraft/server/DataConverterRegistry.java
+@@ -0,0 +0,0 @@ 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, 1)))); // Paper - use more reasonable default
+         DataFixer fixer = datafixerbuilder.build(pool);
+         pool.shutdown();
+         return fixer;
+--
\ No newline at end of file