aboutsummaryrefslogtreecommitdiffhomepage
path: root/Spigot-Server-Patches/0100-Use-Optimized-Collections.patch
diff options
context:
space:
mode:
authorZach Brown <[email protected]>2017-04-29 05:27:31 -0500
committerZach Brown <[email protected]>2017-04-29 05:27:31 -0500
commit974b0afca91844fed61c5fda9293bbcd88752c2f (patch)
treed3a7b65e14f34b7cc8928efaf6403f67eaaaf708 /Spigot-Server-Patches/0100-Use-Optimized-Collections.patch
parent8b2122a291e3ea68f0e1516209914ef43a2d55e9 (diff)
downloadPaper-974b0afca91844fed61c5fda9293bbcd88752c2f.tar.gz
Paper-974b0afca91844fed61c5fda9293bbcd88752c2f.zip
Remove last bit of chunk exists region file fix
CraftBukkit removed their implementation that caused this issue, switching to Mojang's implementation which doesn't appear to share it. I already removed the important bit in the last upstream merge, this is just unused and unnecessary now. So we remove it.
Diffstat (limited to 'Spigot-Server-Patches/0100-Use-Optimized-Collections.patch')
-rw-r--r--Spigot-Server-Patches/0100-Use-Optimized-Collections.patch51
1 files changed, 51 insertions, 0 deletions
diff --git a/Spigot-Server-Patches/0100-Use-Optimized-Collections.patch b/Spigot-Server-Patches/0100-Use-Optimized-Collections.patch
new file mode 100644
index 0000000000..44fc35b3bb
--- /dev/null
+++ b/Spigot-Server-Patches/0100-Use-Optimized-Collections.patch
@@ -0,0 +1,51 @@
+From bf55746ae8469ec426c19372f7fd267fc13b976e Mon Sep 17 00:00:00 2001
+From: Aikar <[email protected]>
+Date: Wed, 30 Mar 2016 02:13:24 -0400
+Subject: [PATCH] Use Optimized Collections
+
+Swap out CraftBukkit LongObjectHashMap with Long2ObjectOpenHashMap
+Swap out Integer key HashMap for a Int2ObjectOpenHashMap For ChunkProviderServer
+
+Amaranth, the creator of LongObjectHashMap, tested it vs fastutil and determined fastutil to be 3x faster
+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 b49f4e292..dd37bec73 100644
+--- a/src/main/java/net/minecraft/server/ChunkProviderServer.java
++++ b/src/main/java/net/minecraft/server/ChunkProviderServer.java
+@@ -24,7 +24,7 @@ import org.bukkit.event.world.ChunkUnloadEvent;
+ public class ChunkProviderServer implements IChunkProvider {
+
+ private static final Logger a = LogManager.getLogger();
+- public final Set<Long> 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 419add5db..820c15278 100644
+--- a/src/main/java/net/minecraft/server/DataWatcher.java
++++ b/src/main/java/net/minecraft/server/DataWatcher.java
+@@ -12,6 +12,7 @@ import java.util.Map;
+ import java.util.concurrent.locks.ReadWriteLock;
+ import java.util.concurrent.locks.ReentrantReadWriteLock;
+ import javax.annotation.Nullable;
++import it.unimi.dsi.fastutil.ints.Int2ObjectOpenHashMap; // Paper
+ import org.apache.commons.lang3.ObjectUtils;
+ import org.apache.logging.log4j.LogManager;
+ import org.apache.logging.log4j.Logger;
+@@ -21,7 +22,7 @@ public class DataWatcher {
+ private static final Logger a = LogManager.getLogger();
+ private static final Map<Class<? extends Entity>, Integer> b = Maps.newHashMap();
+ private final Entity c;
+- private final Map<Integer, DataWatcher.Item<?>> d = Maps.newHashMap();
++ private final Map<Integer, DataWatcher.Item<?>> d = new Int2ObjectOpenHashMap<>(); // Paper
+ private final ReadWriteLock e = new ReentrantReadWriteLock();
+ private boolean f = true;
+ private boolean g;
+--
+2.12.2.windows.2
+