aboutsummaryrefslogtreecommitdiffhomepage
path: root/Spigot-Server-Patches/0171-Optimize-Network-Queue.patch
blob: ef5e41e97e133081272ba1d0f43d227f373a3280 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
From 65234da12571d96b72b7d55fb939a1a4b4c807d9 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 8134501c7..8df30e3d0 100644
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
@@ -103,7 +103,7 @@ public abstract class MinecraftServer implements Runnable, ICommandListener, 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.12.2