From 98854cdf4d56c73a19fd6fdee2bc414d8e5ec147 Mon Sep 17 00:00:00 2001 From: Spottedleaf Date: Sun, 29 Sep 2019 13:49:38 -0700 Subject: [PATCH] Add server oversleep to timings (#2509) Now everything except waiting for the next tick should be included in timings --- .../Basic-PlayerProfile-API.patch | 2 +- ...isPrimaryThread-and-MinecraftServer-.patch | 4 +- ...nt-extended-PaperServerListPingEvent.patch | 2 +- ...ckPhysicsEvent-if-a-plugin-has-a-lis.patch | 4 +- Spigot-Server-Patches/Optimize-Hoppers.patch | 2 +- .../Optimize-World-Time-Updates.patch | 2 +- .../Optimize-explosions.patch | 2 +- .../Server-Tick-Events.patch | 4 +- ...ient-crashes-server-lists-and-Mojang.patch | 10 ++-- Spigot-Server-Patches/Timings-v2.patch | 47 +++++++++++++++++-- ...oleAppender-for-console-improvements.patch | 4 +- .../incremental-chunk-saving.patch | 12 ++--- ...-possibility-for-getServer-singleton.patch | 2 +- 13 files changed, 68 insertions(+), 29 deletions(-) diff --git a/Spigot-Server-Patches/Basic-PlayerProfile-API.patch b/Spigot-Server-Patches/Basic-PlayerProfile-API.patch index d6ddd12b29..5195586594 100644 --- a/Spigot-Server-Patches/Basic-PlayerProfile-API.patch +++ b/Spigot-Server-Patches/Basic-PlayerProfile-API.patch @@ -429,7 +429,7 @@ index 1f6a126329..6d278a0da5 100644 * Calculates distance between 2 entities * @param e1 diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java -index 8fcffc9fa3..32a9e54d0a 100644 +index 6c9a43d66b..6e6c662f95 100644 --- a/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java @@ -0,0 +0,0 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant implements IMojangStatistics, ICommandListener, AutoCloseable, Runnable { +@@ -0,0 +0,0 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant resourcePackRepository; + @Nullable @@ -0,0 +0,0 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant { - return !this.canSleepForTick(); +- return !this.canSleepForTick(); ++ return !this.canSleepForTickNoOversleep(); // Paper - move oversleep into full server tick }); + } + @@ -0,0 +0,0 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant { ++ return !this.canOversleep(); ++ }); ++ MinecraftTimings.serverOversleep.stopTiming(); ++ // Paper end this.slackActivityAccountant.tickStarted(); // Spigot long i = SystemUtils.getMonotonicNanos(); @@ -1166,7 +1205,7 @@ index 1d5e4c5127..60c222b12b 100644 CrashReport crashreport = CrashReport.a(throwable, "Ticking entity"); CrashReportSystemDetails crashreportsystemdetails = crashreport.a("Entity being ticked"); diff --git a/src/main/java/net/minecraft/server/WorldServer.java b/src/main/java/net/minecraft/server/WorldServer.java -index 825e72e53a..a28c97a889 100644 +index 08f824228b..8a7e666473 100644 --- a/src/main/java/net/minecraft/server/WorldServer.java +++ b/src/main/java/net/minecraft/server/WorldServer.java @@ -0,0 +0,0 @@ diff --git a/Spigot-Server-Patches/Use-TerminalConsoleAppender-for-console-improvements.patch b/Spigot-Server-Patches/Use-TerminalConsoleAppender-for-console-improvements.patch index ca8505ac45..854036e61c 100644 --- a/Spigot-Server-Patches/Use-TerminalConsoleAppender-for-console-improvements.patch +++ b/Spigot-Server-Patches/Use-TerminalConsoleAppender-for-console-improvements.patch @@ -185,7 +185,7 @@ index 895049287c..92d0aa6d66 100644 System.setOut(new PrintStream(new LoggerOutputStream(logger, Level.INFO), true)); System.setErr(new PrintStream(new LoggerOutputStream(logger, Level.WARN), true)); diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java -index f621350ea6..8fcffc9fa3 100644 +index 759c713976..6c9a43d66b 100644 --- a/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java @@ -0,0 +0,0 @@ import org.apache.commons.lang3.Validate; @@ -284,7 +284,7 @@ index 8e6f23d278..4c94e85e46 100644 @Override public PluginCommand getPluginCommand(String name) { diff --git a/src/main/java/org/bukkit/craftbukkit/Main.java b/src/main/java/org/bukkit/craftbukkit/Main.java -index ad1da9ddd3..d2bdd7c73f 100644 +index 78534c307c..c1ece9acd4 100644 --- a/src/main/java/org/bukkit/craftbukkit/Main.java +++ b/src/main/java/org/bukkit/craftbukkit/Main.java @@ -0,0 +0,0 @@ import java.util.logging.Logger; diff --git a/Spigot-Server-Patches/incremental-chunk-saving.patch b/Spigot-Server-Patches/incremental-chunk-saving.patch index 3f54581d63..6f731cd887 100644 --- a/Spigot-Server-Patches/incremental-chunk-saving.patch +++ b/Spigot-Server-Patches/incremental-chunk-saving.patch @@ -5,7 +5,7 @@ Subject: [PATCH] incremental chunk saving diff --git a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java -index de11a91af..4d3c6c6b4 100644 +index de11a91af6..4d3c6c6b47 100644 --- a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java +++ b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java @@ -0,0 +0,0 @@ public class PaperWorldConfig { @@ -29,7 +29,7 @@ index de11a91af..4d3c6c6b4 100644 + } } diff --git a/src/main/java/net/minecraft/server/Chunk.java b/src/main/java/net/minecraft/server/Chunk.java -index ee8f80174..2003522d9 100644 +index ee8f801745..2003522d96 100644 --- a/src/main/java/net/minecraft/server/Chunk.java +++ b/src/main/java/net/minecraft/server/Chunk.java @@ -0,0 +0,0 @@ public class Chunk implements IChunkAccess { @@ -42,7 +42,7 @@ index ee8f80174..2003522d9 100644 private long t; @Nullable diff --git a/src/main/java/net/minecraft/server/ChunkProviderServer.java b/src/main/java/net/minecraft/server/ChunkProviderServer.java -index 162700313..535c2258b 100644 +index 1627003134..535c2258b9 100644 --- a/src/main/java/net/minecraft/server/ChunkProviderServer.java +++ b/src/main/java/net/minecraft/server/ChunkProviderServer.java @@ -0,0 +0,0 @@ public class ChunkProviderServer extends IChunkProvider { @@ -62,7 +62,7 @@ index 162700313..535c2258b 100644 public void close() throws IOException { // CraftBukkit start diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java -index c58f6f50d..229336040 100644 +index 098b3e5355..ccf359dff1 100644 --- a/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java @@ -0,0 +0,0 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant 100) { // Spigot diff --git a/src/main/java/net/minecraft/server/PlayerChunkMap.java b/src/main/java/net/minecraft/server/PlayerChunkMap.java -index 493770bf6..2be6fa0f0 100644 +index 493770bf68..2be6fa0f07 100644 --- a/src/main/java/net/minecraft/server/PlayerChunkMap.java +++ b/src/main/java/net/minecraft/server/PlayerChunkMap.java @@ -0,0 +0,0 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d { @@ -147,7 +147,7 @@ index 493770bf6..2be6fa0f0 100644 if (flag) { List list = (List) this.visibleChunks.values().stream().filter(PlayerChunk::hasBeenLoaded).peek(PlayerChunk::m).collect(Collectors.toList()); diff --git a/src/main/java/net/minecraft/server/WorldServer.java b/src/main/java/net/minecraft/server/WorldServer.java -index 8a3124fed..e4cc24806 100644 +index 8a3124fed4..e4cc24806e 100644 --- a/src/main/java/net/minecraft/server/WorldServer.java +++ b/src/main/java/net/minecraft/server/WorldServer.java @@ -0,0 +0,0 @@ public class WorldServer extends World { diff --git a/Spigot-Server-Patches/remove-null-possibility-for-getServer-singleton.patch b/Spigot-Server-Patches/remove-null-possibility-for-getServer-singleton.patch index da4c6d47b4..6d98825300 100644 --- a/Spigot-Server-Patches/remove-null-possibility-for-getServer-singleton.patch +++ b/Spigot-Server-Patches/remove-null-possibility-for-getServer-singleton.patch @@ -6,7 +6,7 @@ Subject: [PATCH] remove null possibility for getServer singleton to stop IDE complaining about potential NPE diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java -index e3bd80c934..17b9e9a31d 100644 +index b4eb53f28a..fbad6a31c1 100644 --- a/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java @@ -0,0 +0,0 @@ import org.spigotmc.SlackActivityAccountant; // Spigot