PaperMC/Spigot-Server-Patches/0150-Optimize-Network-Queue.patch
2018-07-23 09:44:57 +01:00

22 lines
1 KiB
Diff

From e1b901c4c6129afd133c9364c4996e61b03ab618 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 94df23c31f..c97953a2fd 100644
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
@@ -118,7 +118,7 @@ public abstract class MinecraftServer implements IAsyncTaskHandler, IMojangStati
private final GameProfileRepository W;
private final UserCache X;
private long Y;
- protected final Queue<FutureTask<?>> g = Queues.newConcurrentLinkedQueue();
+ protected final Queue<FutureTask<?>> g = new com.destroystokyo.paper.utils.CachedSizeConcurrentLinkedQueue<>(); // Spigot, PAIL: Rename // Paper - Make size() constant-time
private Thread serverThread;
private long aa = SystemUtils.b();
private final IReloadableResourceManager ac;
--
2.18.0