mirror of
https://github.com/PaperMC/Paper.git
synced 2024-11-29 19:52:55 +01:00
Drill down detail of world - doTickRest
This commit is contained in:
parent
84089dc4ae
commit
55b7ca648b
2 changed files with 64 additions and 20 deletions
|
@ -1,4 +1,4 @@
|
|||
From 57f7eba1d84ac95d596f8f87379fce40f9839398 Mon Sep 17 00:00:00 2001
|
||||
From bd13994293a8c2208638965e6072a486e2c0188e Mon Sep 17 00:00:00 2001
|
||||
From: Aikar <aikar@aikar.co>
|
||||
Date: Thu, 10 Jan 2013 00:18:11 -0500
|
||||
Subject: [PATCH] Improved Timings System
|
||||
|
@ -368,7 +368,7 @@ index 6d59bc3..feb657b 100644
|
|||
}
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/WorldServer.java b/src/main/java/net/minecraft/server/WorldServer.java
|
||||
index 3a321da..a2f7fee 100644
|
||||
index 3a321da..5bbf775 100644
|
||||
--- a/src/main/java/net/minecraft/server/WorldServer.java
|
||||
+++ b/src/main/java/net/minecraft/server/WorldServer.java
|
||||
@@ -186,9 +186,12 @@ public class WorldServer extends World implements org.bukkit.BlockChangeDelegate
|
||||
|
@ -380,24 +380,54 @@ index 3a321da..a2f7fee 100644
|
|||
+ timings.mobSpawn.stopTiming(); // Spigot
|
||||
}
|
||||
// CraftBukkit end
|
||||
+ timings.doTickRest.startTiming(); // Spigot
|
||||
+ timings.doChunkUnload.startTiming(); // Spigot
|
||||
this.methodProfiler.c("chunkSource");
|
||||
this.chunkProvider.unloadChunks();
|
||||
int j = this.a(1.0F);
|
||||
@@ -214,6 +217,7 @@ public class WorldServer extends World implements org.bukkit.BlockChangeDelegate
|
||||
this.Z();
|
||||
@@ -199,21 +202,36 @@ public class WorldServer extends World implements org.bukkit.BlockChangeDelegate
|
||||
|
||||
this.worldData.setTime(this.worldData.getTime() + 1L);
|
||||
this.worldData.setDayTime(this.worldData.getDayTime() + 1L);
|
||||
+ timings.doChunkUnload.stopTiming(); // Spigot
|
||||
this.methodProfiler.c("tickPending");
|
||||
+ timings.doTickPending.startTiming(); // Spigot
|
||||
this.a(false);
|
||||
+ timings.doTickPending.stopTiming(); // Spigot
|
||||
this.methodProfiler.c("tickTiles");
|
||||
+ timings.doTickTiles.startTiming(); // Spigot
|
||||
this.g();
|
||||
+ timings.doTickTiles.stopTiming(); // Spigot
|
||||
this.methodProfiler.c("chunkMap");
|
||||
+ timings.doChunkMap.startTiming(); // Spigot
|
||||
this.manager.flush();
|
||||
+ timings.doChunkMap.stopTiming(); // Spigot
|
||||
this.methodProfiler.c("village");
|
||||
+ timings.doVillages.startTiming(); // Spigot
|
||||
this.villages.tick();
|
||||
this.siegeManager.a();
|
||||
+ timings.doVillages.stopTiming(); // Spigot
|
||||
this.methodProfiler.c("portalForcer");
|
||||
+ timings.doPortalForcer.startTiming(); // Spigot
|
||||
this.P.a(this.getTime());
|
||||
+ timings.doPortalForcer.stopTiming(); // Spigot
|
||||
this.methodProfiler.b();
|
||||
+ timings.doSounds.startTiming(); // Spigot
|
||||
this.Z();
|
||||
-
|
||||
+ timings.doSounds.stopTiming(); // Spigot
|
||||
+ timings.doChunkGC.startTiming(); // Spigot
|
||||
this.getWorld().processChunkGC(); // CraftBukkit
|
||||
+ timings.doTickRest.stopTiming(); // Spigot
|
||||
+ timings.doChunkGC.stopTiming(); // Spigot
|
||||
+
|
||||
}
|
||||
|
||||
public BiomeMeta a(EnumCreatureType enumcreaturetype, int i, int j, int k) {
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/SpigotTimings.java b/src/main/java/org/bukkit/craftbukkit/SpigotTimings.java
|
||||
new file mode 100644
|
||||
index 0000000..f5befbf
|
||||
index 0000000..f6e507e
|
||||
--- /dev/null
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/SpigotTimings.java
|
||||
@@ -0,0 +1,110 @@
|
||||
@@ -0,0 +1,124 @@
|
||||
+package org.bukkit.craftbukkit;
|
||||
+
|
||||
+import net.minecraft.server.*;
|
||||
|
@ -490,7 +520,14 @@ index 0000000..f5befbf
|
|||
+ */
|
||||
+ public static class WorldTimingsHandler {
|
||||
+ public final CustomTimingsHandler mobSpawn;
|
||||
+ public final CustomTimingsHandler doTickRest;
|
||||
+ public final CustomTimingsHandler doChunkUnload;
|
||||
+ public final CustomTimingsHandler doPortalForcer;
|
||||
+ public final CustomTimingsHandler doTickPending;
|
||||
+ public final CustomTimingsHandler doTickTiles;
|
||||
+ public final CustomTimingsHandler doVillages;
|
||||
+ public final CustomTimingsHandler doChunkMap;
|
||||
+ public final CustomTimingsHandler doChunkGC;
|
||||
+ public final CustomTimingsHandler doSounds;
|
||||
+ public final CustomTimingsHandler entityTick;
|
||||
+ public final CustomTimingsHandler tileEntityTick;
|
||||
+ public final CustomTimingsHandler tileEntityPending;
|
||||
|
@ -500,7 +537,14 @@ index 0000000..f5befbf
|
|||
+ String name = server.worldData.getName() +" - ";
|
||||
+
|
||||
+ mobSpawn = new CustomTimingsHandler(name + "mobSpawn");
|
||||
+ doTickRest = new CustomTimingsHandler(name + "doTickRest");
|
||||
+ doChunkUnload = new CustomTimingsHandler(name + "doChunkUnload");
|
||||
+ doTickPending = new CustomTimingsHandler(name + "doTickPending");
|
||||
+ doTickTiles = new CustomTimingsHandler(name + "doTickTiles");
|
||||
+ doVillages = new CustomTimingsHandler(name + "doVillages");
|
||||
+ doChunkMap = new CustomTimingsHandler(name + "doChunkMap");
|
||||
+ doSounds = new CustomTimingsHandler(name + "doSounds");
|
||||
+ doChunkGC = new CustomTimingsHandler(name + "doChunkGC");
|
||||
+ doPortalForcer = new CustomTimingsHandler(name + "doPortalForcer");
|
||||
+ entityTick = new CustomTimingsHandler(name + "entityTick");
|
||||
+ tileEntityTick = new CustomTimingsHandler(name + "tileEntityTick");
|
||||
+ tileEntityPending = new CustomTimingsHandler(name + "tileEntityPending");
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
From c54f4556a24657fde44ca90d32acbae0cb9313ae Mon Sep 17 00:00:00 2001
|
||||
From 9dea1322ad60ddc96a42387dd4f8e5ff2093238b Mon Sep 17 00:00:00 2001
|
||||
From: Mike Primm <mike@primmhome.com>
|
||||
Date: Wed, 24 Apr 2013 01:43:33 -0500
|
||||
Subject: [PATCH] Improve next-tick-list performance on chunk unloads, large
|
||||
|
@ -19,7 +19,7 @@ index 52a70a1..08a4240 100644
|
|||
|
||||
public NextTickListEntry a(long i) {
|
||||
diff --git a/src/main/java/net/minecraft/server/WorldServer.java b/src/main/java/net/minecraft/server/WorldServer.java
|
||||
index a2f7fee..b0c2c96 100644
|
||||
index 5bbf775..1b2526b 100644
|
||||
--- a/src/main/java/net/minecraft/server/WorldServer.java
|
||||
+++ b/src/main/java/net/minecraft/server/WorldServer.java
|
||||
@@ -28,8 +28,8 @@ public class WorldServer extends World implements org.bukkit.BlockChangeDelegate
|
||||
|
@ -63,7 +63,7 @@ index a2f7fee..b0c2c96 100644
|
|||
|
||||
this.P = new org.bukkit.craftbukkit.CraftTravelAgent(this); // CraftBukkit
|
||||
this.scoreboard = new ScoreboardServer(minecraftserver);
|
||||
@@ -444,9 +447,16 @@ public class WorldServer extends World implements org.bukkit.BlockChangeDelegate
|
||||
@@ -458,9 +461,16 @@ public class WorldServer extends World implements org.bukkit.BlockChangeDelegate
|
||||
}
|
||||
|
||||
public boolean a(int i, int j, int k, int l) {
|
||||
|
@ -83,7 +83,7 @@ index a2f7fee..b0c2c96 100644
|
|||
}
|
||||
|
||||
public void a(int i, int j, int k, int l, int i1) {
|
||||
@@ -479,10 +489,9 @@ public class WorldServer extends World implements org.bukkit.BlockChangeDelegate
|
||||
@@ -493,10 +503,9 @@ public class WorldServer extends World implements org.bukkit.BlockChangeDelegate
|
||||
nextticklistentry.a(j1);
|
||||
}
|
||||
|
||||
|
@ -97,7 +97,7 @@ index a2f7fee..b0c2c96 100644
|
|||
}
|
||||
}
|
||||
|
||||
@@ -494,10 +503,9 @@ public class WorldServer extends World implements org.bukkit.BlockChangeDelegate
|
||||
@@ -508,10 +517,9 @@ public class WorldServer extends World implements org.bukkit.BlockChangeDelegate
|
||||
nextticklistentry.a((long) i1 + this.worldData.getTime());
|
||||
}
|
||||
|
||||
|
@ -111,7 +111,7 @@ index a2f7fee..b0c2c96 100644
|
|||
}
|
||||
|
||||
public void tickEntities() {
|
||||
@@ -517,11 +525,12 @@ public class WorldServer extends World implements org.bukkit.BlockChangeDelegate
|
||||
@@ -531,11 +539,12 @@ public class WorldServer extends World implements org.bukkit.BlockChangeDelegate
|
||||
}
|
||||
|
||||
public boolean a(boolean flag) {
|
||||
|
@ -128,7 +128,7 @@ index a2f7fee..b0c2c96 100644
|
|||
if (i > 1000) {
|
||||
// CraftBukkit start - If the server has too much to process over time, try to alleviate that
|
||||
if (i > 20 * 1000) {
|
||||
@@ -537,23 +546,24 @@ public class WorldServer extends World implements org.bukkit.BlockChangeDelegate
|
||||
@@ -551,23 +560,24 @@ public class WorldServer extends World implements org.bukkit.BlockChangeDelegate
|
||||
NextTickListEntry nextticklistentry;
|
||||
|
||||
for (int j = 0; j < i; ++j) {
|
||||
|
@ -162,7 +162,7 @@ index a2f7fee..b0c2c96 100644
|
|||
byte b0 = 0;
|
||||
|
||||
if (this.e(nextticklistentry.a - b0, nextticklistentry.b - b0, nextticklistentry.c - b0, nextticklistentry.a + b0, nextticklistentry.b + b0, nextticklistentry.c + b0)) {
|
||||
@@ -584,52 +594,18 @@ public class WorldServer extends World implements org.bukkit.BlockChangeDelegate
|
||||
@@ -598,52 +608,18 @@ public class WorldServer extends World implements org.bukkit.BlockChangeDelegate
|
||||
}
|
||||
|
||||
this.methodProfiler.b();
|
||||
|
@ -224,7 +224,7 @@ index a2f7fee..b0c2c96 100644
|
|||
}
|
||||
|
||||
public void entityJoinedWorld(Entity entity, boolean flag) {
|
||||
@@ -706,13 +682,15 @@ public class WorldServer extends World implements org.bukkit.BlockChangeDelegate
|
||||
@@ -720,13 +696,15 @@ public class WorldServer extends World implements org.bukkit.BlockChangeDelegate
|
||||
this.entitiesById = new IntHashMap();
|
||||
}
|
||||
|
||||
|
@ -244,7 +244,7 @@ index a2f7fee..b0c2c96 100644
|
|||
|
||||
this.b(worldsettings);
|
||||
super.a(worldsettings);
|
||||
@@ -999,4 +977,62 @@ public class WorldServer extends World implements org.bukkit.BlockChangeDelegate
|
||||
@@ -1013,4 +991,62 @@ public class WorldServer extends World implements org.bukkit.BlockChangeDelegate
|
||||
return this.setTypeIdAndData(x, y, z, typeId, data, 3);
|
||||
}
|
||||
// CraftBukkit end
|
||||
|
|
Loading…
Reference in a new issue