diff options
Diffstat (limited to 'Spigot-Server-Patches/0005-Timings-v2.patch')
-rw-r--r-- | Spigot-Server-Patches/0005-Timings-v2.patch | 137 |
1 files changed, 20 insertions, 117 deletions
diff --git a/Spigot-Server-Patches/0005-Timings-v2.patch b/Spigot-Server-Patches/0005-Timings-v2.patch index 5d4ce1a830..2cdfc8297c 100644 --- a/Spigot-Server-Patches/0005-Timings-v2.patch +++ b/Spigot-Server-Patches/0005-Timings-v2.patch @@ -1,4 +1,4 @@ -From 816dc32418ed79b5a38e7a4b5bc58bddc8123af1 Mon Sep 17 00:00:00 2001 +From 42571345704ae6d7b8139b39bf4d90eeed7582bc Mon Sep 17 00:00:00 2001 From: Aikar <[email protected]> Date: Thu, 3 Mar 2016 04:00:11 -0600 Subject: [PATCH] Timings v2 @@ -23,7 +23,7 @@ index 4ae34c8..63aaa7a 100644 <version>3.0.3</version> diff --git a/src/main/java/co/aikar/timings/MinecraftTimings.java b/src/main/java/co/aikar/timings/MinecraftTimings.java new file mode 100644 -index 0000000..29838de +index 0000000..2dff5e3 --- /dev/null +++ b/src/main/java/co/aikar/timings/MinecraftTimings.java @@ -0,0 +1,114 @@ @@ -45,7 +45,7 @@ index 0000000..29838de + public static final Timing chunkIOTickTimer = Timings.ofSafe("ChunkIOTick"); + public static final Timing timeUpdateTimer = Timings.ofSafe("Time Update"); + public static final Timing serverCommandTimer = Timings.ofSafe("Server Command"); -+ public static final Timing savePlayers = Timings.ofSafe("Save Players"); ++ public static final Timing worldSaveTimer = Timings.ofSafe("World Save"); + + public static final Timing tickEntityTimer = Timings.ofSafe("## tickEntity"); + public static final Timing tickTileEntityTimer = Timings.ofSafe("## tickTileEntity"); @@ -275,10 +275,10 @@ index 0000000..2bf5b66 +} diff --git a/src/main/java/co/aikar/timings/WorldTimingsHandler.java b/src/main/java/co/aikar/timings/WorldTimingsHandler.java new file mode 100644 -index 0000000..e778911 +index 0000000..36aafb2 --- /dev/null +++ b/src/main/java/co/aikar/timings/WorldTimingsHandler.java -@@ -0,0 +1,101 @@ +@@ -0,0 +1,91 @@ +package co.aikar.timings; + +import net.minecraft.server.World; @@ -325,11 +325,6 @@ index 0000000..e778911 + public final Timing chunkGeneration; + public final Timing chunkIOStage1; + public final Timing chunkIOStage2; -+ public final Timing worldSave; -+ public final Timing worldSaveChunks; -+ public final Timing worldSaveLevel; -+ public final Timing chunkSaveNop; -+ public final Timing chunkSaveData; + + public WorldTimingsHandler(World server) { + String name = server.worldData.getName() +" - "; @@ -368,11 +363,6 @@ index 0000000..e778911 + chunkGeneration = Timings.ofSafe(name + "chunkGeneration"); + chunkIOStage1 = Timings.ofSafe(name + "ChunkIO Stage 1 - DiskIO"); + chunkIOStage2 = Timings.ofSafe(name + "ChunkIO Stage 2 - Post Load"); -+ worldSave = Timings.ofSafe(name + "World Save"); -+ worldSaveLevel = Timings.ofSafe(name + "World Save - Level"); -+ worldSaveChunks = Timings.ofSafe(name + "World Save - Chunks"); -+ chunkSaveNop = Timings.ofSafe(name + "Chunk Save - NOP"); -+ chunkSaveData = Timings.ofSafe(name + "Chunk Save - Data"); + + tracker1 = Timings.ofSafe(name + "tracker stage 1"); + tracker2 = Timings.ofSafe(name + "tracker stage 2"); @@ -492,28 +482,6 @@ index b651edc..5807bb8 100644 } private void z() { -diff --git a/src/main/java/net/minecraft/server/ChunkProviderServer.java b/src/main/java/net/minecraft/server/ChunkProviderServer.java -index 5682f03..1380815 100644 ---- a/src/main/java/net/minecraft/server/ChunkProviderServer.java -+++ b/src/main/java/net/minecraft/server/ChunkProviderServer.java -@@ -194,7 +194,7 @@ public class ChunkProviderServer implements IChunkProvider { - } - - public void saveChunkNOP(Chunk chunk) { -- try { -+ try (co.aikar.timings.Timing timed = world.timings.chunkSaveNop.startTiming()) { - this.chunkLoader.b(this.world, chunk); - } catch (Exception exception) { - ChunkProviderServer.a.error("Couldn\'t save entities", exception); -@@ -203,7 +203,7 @@ public class ChunkProviderServer implements IChunkProvider { - } - - public void saveChunk(Chunk chunk) { -- try { -+ try (co.aikar.timings.Timing timed = world.timings.chunkSaveData.startTiming()) { - chunk.setLastSaved(this.world.getTime()); - this.chunkLoader.a(this.world, chunk); - } catch (IOException ioexception) { diff --git a/src/main/java/net/minecraft/server/ChunkRegionLoader.java b/src/main/java/net/minecraft/server/ChunkRegionLoader.java index f604639..17dd7bb 100644 --- a/src/main/java/net/minecraft/server/ChunkRegionLoader.java @@ -727,7 +695,7 @@ index 5432e70..72cd51a 100644 } diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java -index 26f8467..4814643 100644 +index 26f8467..891c7ea 100644 --- a/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java @@ -45,7 +45,7 @@ import org.bukkit.Bukkit; @@ -756,23 +724,25 @@ index 26f8467..4814643 100644 long i = System.nanoTime(); ++this.ticks; -@@ -681,7 +682,6 @@ public abstract class MinecraftServer implements Runnable, ICommandListener, IAs +@@ -681,7 +682,7 @@ public abstract class MinecraftServer implements Runnable, ICommandListener, IAs } if (autosavePeriod > 0 && this.ticks % autosavePeriod == 0) { // CraftBukkit - SpigotTimings.worldSaveTimer.startTiming(); // Spigot ++ MinecraftTimings.worldSaveTimer.startTiming(); // Spigot this.methodProfiler.a("save"); this.v.savePlayers(); // Spigot Start -@@ -696,7 +696,6 @@ public abstract class MinecraftServer implements Runnable, ICommandListener, IAs +@@ -696,7 +697,7 @@ public abstract class MinecraftServer implements Runnable, ICommandListener, IAs // this.saveChunks(true); // Spigot End this.methodProfiler.b(); - SpigotTimings.worldSaveTimer.stopTiming(); // Spigot ++ MinecraftTimings.worldSaveTimer.stopTiming(); // Spigot } this.methodProfiler.a("tallying"); -@@ -713,15 +712,16 @@ public abstract class MinecraftServer implements Runnable, ICommandListener, IAs +@@ -713,15 +714,16 @@ public abstract class MinecraftServer implements Runnable, ICommandListener, IAs this.methodProfiler.b(); this.methodProfiler.b(); @@ -793,7 +763,7 @@ index 26f8467..4814643 100644 this.methodProfiler.a("jobs"); Queue queue = this.j; -@@ -732,22 +732,23 @@ public abstract class MinecraftServer implements Runnable, ICommandListener, IAs +@@ -732,22 +734,23 @@ public abstract class MinecraftServer implements Runnable, ICommandListener, IAs SystemUtils.a(entry, MinecraftServer.LOGGER); } // Spigot end @@ -822,7 +792,7 @@ index 26f8467..4814643 100644 // Send time updates to everyone, it will get the right time from the world the player is in. if (this.ticks % 20 == 0) { for (int i = 0; i < this.getPlayerList().players.size(); ++i) { -@@ -755,7 +756,7 @@ public abstract class MinecraftServer implements Runnable, ICommandListener, IAs +@@ -755,7 +758,7 @@ public abstract class MinecraftServer implements Runnable, ICommandListener, IAs entityplayer.playerConnection.sendPacket(new PacketPlayOutUpdateTime(entityplayer.world.getTime(), entityplayer.getPlayerTime(), entityplayer.world.getGameRules().getBoolean("doDaylightCycle"))); // Add support for per player time } } @@ -831,7 +801,7 @@ index 26f8467..4814643 100644 int i; -@@ -812,9 +813,7 @@ public abstract class MinecraftServer implements Runnable, ICommandListener, IAs +@@ -812,9 +815,7 @@ public abstract class MinecraftServer implements Runnable, ICommandListener, IAs this.methodProfiler.b(); this.methodProfiler.a("tracker"); @@ -841,7 +811,7 @@ index 26f8467..4814643 100644 this.methodProfiler.b(); this.methodProfiler.b(); // } // CraftBukkit -@@ -823,20 +822,20 @@ public abstract class MinecraftServer implements Runnable, ICommandListener, IAs +@@ -823,20 +824,20 @@ public abstract class MinecraftServer implements Runnable, ICommandListener, IAs } this.methodProfiler.c("connection"); @@ -969,7 +939,7 @@ index b0249ff..797a84f 100644 } diff --git a/src/main/java/net/minecraft/server/PlayerConnection.java b/src/main/java/net/minecraft/server/PlayerConnection.java -index f47c5fc..ae576f0 100644 +index 8f42ac8..0546cb8 100644 --- a/src/main/java/net/minecraft/server/PlayerConnection.java +++ b/src/main/java/net/minecraft/server/PlayerConnection.java @@ -57,6 +57,7 @@ import org.bukkit.inventory.CraftingInventory; @@ -980,7 +950,7 @@ index f47c5fc..ae576f0 100644 // CraftBukkit end public class PlayerConnection implements PacketListenerPlayIn, ITickable { -@@ -1339,7 +1340,7 @@ public class PlayerConnection implements PacketListenerPlayIn, ITickable { +@@ -1341,7 +1342,7 @@ public class PlayerConnection implements PacketListenerPlayIn, ITickable { // CraftBukkit end private void handleCommand(String s) { @@ -989,7 +959,7 @@ index f47c5fc..ae576f0 100644 // CraftBukkit start - whole method if ( org.spigotmc.SpigotConfig.logCommands ) // Spigot this.LOGGER.info(this.player.getName() + " issued server command: " + s); -@@ -1350,22 +1351,22 @@ public class PlayerConnection implements PacketListenerPlayIn, ITickable { +@@ -1352,22 +1353,22 @@ public class PlayerConnection implements PacketListenerPlayIn, ITickable { this.server.getPluginManager().callEvent(event); if (event.isCancelled()) { @@ -1016,30 +986,6 @@ index f47c5fc..ae576f0 100644 // this.minecraftServer.getCommandHandler().a(this.player, s); // CraftBukkit end } -diff --git a/src/main/java/net/minecraft/server/PlayerList.java b/src/main/java/net/minecraft/server/PlayerList.java -index 6bd7151..1b2cc01 100644 ---- a/src/main/java/net/minecraft/server/PlayerList.java -+++ b/src/main/java/net/minecraft/server/PlayerList.java -@@ -1,5 +1,6 @@ - package net.minecraft.server; - -+import co.aikar.timings.MinecraftTimings; - import com.google.common.collect.Lists; - import com.google.common.collect.Maps; - import com.google.common.collect.Sets; -@@ -1167,10 +1168,11 @@ public abstract class PlayerList { - } - - public void savePlayers() { -+ MinecraftTimings.savePlayers.startTiming(); // Paper - for (int i = 0; i < this.players.size(); ++i) { - this.savePlayerFile((EntityPlayer) this.players.get(i)); - } -- -+ MinecraftTimings.savePlayers.stopTiming(); // Paper - } - - public void addWhitelist(GameProfile gameprofile) { diff --git a/src/main/java/net/minecraft/server/StructureGenerator.java b/src/main/java/net/minecraft/server/StructureGenerator.java index 8dd434c..c965af1 100644 --- a/src/main/java/net/minecraft/server/StructureGenerator.java @@ -1209,7 +1155,7 @@ index e649435..b73f64e 100644 } diff --git a/src/main/java/net/minecraft/server/WorldServer.java b/src/main/java/net/minecraft/server/WorldServer.java -index 50fad7c..3d98392 100644 +index 50fad7c..769d55b 100644 --- a/src/main/java/net/minecraft/server/WorldServer.java +++ b/src/main/java/net/minecraft/server/WorldServer.java @@ -246,13 +246,13 @@ public class WorldServer extends World implements IAsyncTaskHandler { @@ -1298,49 +1244,6 @@ index 50fad7c..3d98392 100644 // CraftBukkit end } -@@ -1007,6 +1015,7 @@ public class WorldServer extends World implements IAsyncTaskHandler { - - if (chunkproviderserver.e()) { - org.bukkit.Bukkit.getPluginManager().callEvent(new org.bukkit.event.world.WorldSaveEvent(getWorld())); // CraftBukkit -+ timings.worldSave.startTiming(); // Paper - if (iprogressupdate != null) { - iprogressupdate.a("Saving level"); - } -@@ -1016,7 +1025,9 @@ public class WorldServer extends World implements IAsyncTaskHandler { - iprogressupdate.c("Saving chunks"); - } - -+ timings.worldSaveChunks.startTiming(); // Paper - chunkproviderserver.a(flag); -+ timings.worldSaveChunks.stopTiming(); // Paper - // CraftBukkit - ArrayList -> Collection - Collection arraylist = chunkproviderserver.a(); - Iterator iterator = arraylist.iterator(); -@@ -1028,7 +1039,7 @@ public class WorldServer extends World implements IAsyncTaskHandler { - chunkproviderserver.unload(chunk); - } - } -- -+ timings.worldSave.stopTiming(); // Paper - } - } - -@@ -1041,6 +1052,7 @@ public class WorldServer extends World implements IAsyncTaskHandler { - } - - protected void a() throws ExceptionWorldConflict { -+ timings.worldSaveLevel.startTiming(); // Paper - this.checkSession(); - WorldServer[] aworldserver = this.server.worldServer; - int i = aworldserver.length; -@@ -1070,6 +1082,7 @@ public class WorldServer extends World implements IAsyncTaskHandler { - this.worldData.e(this.getWorldBorder().i()); - this.dataManager.saveWorldData(this.worldData, this.server.getPlayerList().t()); - this.worldMaps.a(); -+ timings.worldSaveLevel.stopTiming(); // Paper - } - - // CraftBukkit start diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java index e7e9941..5f2a9b0 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java @@ -1833,5 +1736,5 @@ index 30efc99..eb30abe 100644 } } -- -2.10.1 +2.9.3 |