mirror of
https://github.com/PaperMC/Paper.git
synced 2024-11-03 01:10:37 +01:00
18c3716c49
This enables us a fast reference to the entities current chunk instead of having to look it up by hashmap lookups. We also store counts by type to further enable other performance optimizations in later patches.
23 lines
1.0 KiB
Diff
23 lines
1.0 KiB
Diff
From d3c90cc09b0a21f0ff27b57d39cff7634386b55f 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 5c09c6ff7..13c6b5ccd 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.18.0
|
|
|