PaperMC/Spigot-Server-Patches/0168-Optimize-Network-Queue.patch
2017-08-03 17:27:54 +02:00

22 lines
1 KiB
Diff

From fce3d36c12fc004e027c4eee7d5de6e034bb9032 Mon Sep 17 00:00:00 2001
From: vemacs <d@nkmem.es>
Date: Wed, 23 Nov 2016 12:54:56 -0500
Subject: [PATCH] Optimize Network Queue
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
index 86eac80a1..005e3449f 100644
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
@@ -104,7 +104,7 @@ public abstract class MinecraftServer implements ICommandListener, Runnable, IAs
private final GameProfileRepository X;
private final UserCache Y;
private long Z;
- protected final Queue<FutureTask<?>> j = new java.util.concurrent.ConcurrentLinkedQueue<FutureTask<?>>(); // Spigot, PAIL: Rename
+ protected final Queue<FutureTask<?>> j = new com.destroystokyo.paper.utils.CachedSizeConcurrentLinkedQueue<>(); // Spigot, PAIL: Rename // Paper - Make size() constant-time
private Thread serverThread;
private long ab = aw();
--
2.13.3.windows.1