aboutsummaryrefslogtreecommitdiffhomepage
path: root/patches/server/0756-Distance-manager-tick-timings.patch
diff options
context:
space:
mode:
authorJake Potrebic <[email protected]>2022-03-04 00:09:43 -0800
committerGitHub <[email protected]>2022-03-04 09:09:43 +0100
commit15b6b3db2cf24c98afbfb0849e694875d18fc021 (patch)
tree03e884d0c7fe2ce292825b5b51ec4c9a6ce2e8cc /patches/server/0756-Distance-manager-tick-timings.patch
parent753bf2c1034c5f35cc0839001d12363a44f936fc (diff)
downloadPaper-15b6b3db2cf24c98afbfb0849e694875d18fc021.tar.gz
Paper-15b6b3db2cf24c98afbfb0849e694875d18fc021.zip
Add StructuresLocateEvent as replacement for StructureLocateEvent (#7524)
Diffstat (limited to 'patches/server/0756-Distance-manager-tick-timings.patch')
-rw-r--r--patches/server/0756-Distance-manager-tick-timings.patch40
1 files changed, 40 insertions, 0 deletions
diff --git a/patches/server/0756-Distance-manager-tick-timings.patch b/patches/server/0756-Distance-manager-tick-timings.patch
new file mode 100644
index 0000000000..69c8bf095e
--- /dev/null
+++ b/patches/server/0756-Distance-manager-tick-timings.patch
@@ -0,0 +1,40 @@
+From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
+From: Spottedleaf <[email protected]>
+Date: Sat, 18 Jul 2020 16:03:57 -0700
+Subject: [PATCH] Distance manager tick timings
+
+Recently this has been taking up more time, so add a timings to
+really figure out how much.
+
+diff --git a/src/main/java/co/aikar/timings/MinecraftTimings.java b/src/main/java/co/aikar/timings/MinecraftTimings.java
+index eada966d7f108a6081be7a848f5c1dfcb1eed676..a977f7483f37df473096b2234dc1308bbaa6a8b6 100644
+--- a/src/main/java/co/aikar/timings/MinecraftTimings.java
++++ b/src/main/java/co/aikar/timings/MinecraftTimings.java
+@@ -44,6 +44,7 @@ public final class MinecraftTimings {
+
+ public static final Timing antiXrayUpdateTimer = Timings.ofSafe("anti-xray - update");
+ public static final Timing antiXrayObfuscateTimer = Timings.ofSafe("anti-xray - obfuscate");
++ public static final Timing distanceManagerTick = Timings.ofSafe("Distance Manager Tick"); // Paper - add timings for distance manager
+
+ public static final Timing midTickChunkTasks = Timings.ofSafe("Mid Tick Chunk Tasks");
+
+diff --git a/src/main/java/net/minecraft/server/level/ServerChunkCache.java b/src/main/java/net/minecraft/server/level/ServerChunkCache.java
+index b73f49b9bf49dc2a08aa8ffece675df41c077412..5271cc135e636961fc1248f6b98bb122ab3391e6 100644
+--- a/src/main/java/net/minecraft/server/level/ServerChunkCache.java
++++ b/src/main/java/net/minecraft/server/level/ServerChunkCache.java
+@@ -831,6 +831,7 @@ public class ServerChunkCache extends ChunkSource {
+ public boolean runDistanceManagerUpdates() {
+ if (distanceManager.delayDistanceManagerTick) return false; // Paper - Chunk priority
+ if (this.chunkMap.unloadingPlayerChunk) { LOGGER.error("Cannot tick distance manager while unloading playerchunks", new Throwable()); throw new IllegalStateException("Cannot tick distance manager while unloading playerchunks"); } // Paper
++ co.aikar.timings.MinecraftTimings.distanceManagerTick.startTiming(); try { // Paper - add timings for distance manager
+ boolean flag = this.distanceManager.runAllUpdates(this.chunkMap);
+ boolean flag1 = this.chunkMap.promoteChunkMap();
+
+@@ -840,6 +841,7 @@ public class ServerChunkCache extends ChunkSource {
+ this.clearCache();
+ return true;
+ }
++ } finally { co.aikar.timings.MinecraftTimings.distanceManagerTick.stopTiming(); } // Paper - add timings for distance manager
+ }
+
+ // Paper start - helper