From 89ff242bd49a9b39f59fc88ebbe57aab1ef9cd15 Mon Sep 17 00:00:00 2001 From: Aikar Date: Thu, 27 Jul 2017 00:25:13 -0400 Subject: [PATCH] Remove use of FastUtil for unload queue, very bad performance --- .../Chunk-Save-Stats-Debug-Option.patch | 6 +++--- .../Use-Optimized-Collections.patch | 15 +-------------- 2 files changed, 4 insertions(+), 17 deletions(-) diff --git a/Spigot-Server-Patches/Chunk-Save-Stats-Debug-Option.patch b/Spigot-Server-Patches/Chunk-Save-Stats-Debug-Option.patch index f35f067708..6e08eec16b 100644 --- a/Spigot-Server-Patches/Chunk-Save-Stats-Debug-Option.patch +++ b/Spigot-Server-Patches/Chunk-Save-Stats-Debug-Option.patch @@ -8,11 +8,11 @@ Adds a command line flag to enable stats on how chunk saves are processing. Stats on current queue, how many was processed and how many were queued. diff --git a/src/main/java/net/minecraft/server/ChunkProviderServer.java b/src/main/java/net/minecraft/server/ChunkProviderServer.java -index 19f10fed..9159ed02 100644 +index ef194312b..8fca62eec 100644 --- a/src/main/java/net/minecraft/server/ChunkProviderServer.java +++ b/src/main/java/net/minecraft/server/ChunkProviderServer.java @@ -0,0 +0,0 @@ public class ChunkProviderServer implements IChunkProvider { - public final it.unimi.dsi.fastutil.longs.LongSet unloadQueue = new it.unimi.dsi.fastutil.longs.LongArraySet(); // PAIL: private -> public // Paper + public final Set unloadQueue = Sets.newHashSet(); public final ChunkGenerator chunkGenerator; private final IChunkLoader chunkLoader; + // Paper start - chunk save stats @@ -55,7 +55,7 @@ index 19f10fed..9159ed02 100644 return false; } diff --git a/src/main/java/net/minecraft/server/ChunkRegionLoader.java b/src/main/java/net/minecraft/server/ChunkRegionLoader.java -index ceef6e45..d275eb19 100644 +index ceef6e456..d275eb194 100644 --- a/src/main/java/net/minecraft/server/ChunkRegionLoader.java +++ b/src/main/java/net/minecraft/server/ChunkRegionLoader.java @@ -0,0 +0,0 @@ public class ChunkRegionLoader implements IChunkLoader, IAsyncChunkSaver { diff --git a/Spigot-Server-Patches/Use-Optimized-Collections.patch b/Spigot-Server-Patches/Use-Optimized-Collections.patch index 283fdcb16a..d87b1b850d 100644 --- a/Spigot-Server-Patches/Use-Optimized-Collections.patch +++ b/Spigot-Server-Patches/Use-Optimized-Collections.patch @@ -12,21 +12,8 @@ and could not create anything faster than fastutil. These collections are super fast as seen http://java-performance.info/hashmap-overview-jdk-fastutil-goldman-sachs-hppc-koloboke-trove-january-2015/ -diff --git a/src/main/java/net/minecraft/server/ChunkProviderServer.java b/src/main/java/net/minecraft/server/ChunkProviderServer.java -index c81b404b..4d0cb971 100644 ---- a/src/main/java/net/minecraft/server/ChunkProviderServer.java -+++ b/src/main/java/net/minecraft/server/ChunkProviderServer.java -@@ -0,0 +0,0 @@ import org.bukkit.event.world.ChunkUnloadEvent; - public class ChunkProviderServer implements IChunkProvider { - - private static final Logger a = LogManager.getLogger(); -- public final Set unloadQueue = Sets.newHashSet(); -+ public final it.unimi.dsi.fastutil.longs.LongSet unloadQueue = new it.unimi.dsi.fastutil.longs.LongArraySet(); // PAIL: private -> public // Paper - public final ChunkGenerator chunkGenerator; - private final IChunkLoader chunkLoader; - // Paper start diff --git a/src/main/java/net/minecraft/server/DataWatcher.java b/src/main/java/net/minecraft/server/DataWatcher.java -index 1507f97f..fe848445 100644 +index 1507f97fd..fe8484453 100644 --- a/src/main/java/net/minecraft/server/DataWatcher.java +++ b/src/main/java/net/minecraft/server/DataWatcher.java @@ -0,0 +0,0 @@ import java.util.Map;