Paper/Spigot-Server-Patches/0150-Optimize-Network-Queue.patch

23 lines
1.0 KiB
Diff
Raw Normal View History

2018-07-23 10:39:55 +02:00
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
2018-07-23 10:39:55 +02:00
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