mirror of
https://github.com/PurpurMC/Purpur.git
synced 2026-02-17 16:37:43 +01:00
711 lines
40 KiB
Diff
711 lines
40 KiB
Diff
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
From: BillyGalbreath <blake.galbreath@gmail.com>
|
|
Date: Fri, 1 Jul 2022 04:03:37 -0500
|
|
Subject: [PATCH] Remove Timings
|
|
|
|
|
|
diff --git a/src/main/java/io/papermc/paper/command/brigadier/bukkit/BukkitCommandNode.java b/src/main/java/io/papermc/paper/command/brigadier/bukkit/BukkitCommandNode.java
|
|
index 0c3c82b28e581286b798ee58ca4193efc2faff4a..24121a43aeb5e9bce013f30c92dddd15f99736c6 100644
|
|
--- a/src/main/java/io/papermc/paper/command/brigadier/bukkit/BukkitCommandNode.java
|
|
+++ b/src/main/java/io/papermc/paper/command/brigadier/bukkit/BukkitCommandNode.java
|
|
@@ -80,16 +80,16 @@ public class BukkitCommandNode extends LiteralCommandNode<CommandSourceStack> {
|
|
|
|
// Plugins do weird things to workaround normal registration
|
|
if (this.command.timings == null) {
|
|
- this.command.timings = co.aikar.timings.TimingsManager.getCommandTiming(null, this.command);
|
|
+ //this.command.timings = co.aikar.timings.TimingsManager.getCommandTiming(null, this.command); // Purpur
|
|
}
|
|
|
|
String content = context.getRange().get(context.getInput());
|
|
String[] args = org.apache.commons.lang3.StringUtils.split(content, ' '); // fix adjacent spaces (from console/plugins) causing empty array elements
|
|
|
|
- try (Timing ignored = this.command.timings.startTiming()) {
|
|
+ //try (Timing ignored = this.command.timings.startTiming()) { // Purpur
|
|
// Note: we don't return the result of target.execute as thats success / failure, we return handled (true) or not handled (false)
|
|
this.command.execute(sender, this.literal, Arrays.copyOfRange(args, 1, args.length));
|
|
- }
|
|
+ //} // Purpur
|
|
|
|
// return true as command was handled
|
|
return 1;
|
|
diff --git a/src/main/java/net/minecraft/network/protocol/PacketUtils.java b/src/main/java/net/minecraft/network/protocol/PacketUtils.java
|
|
index d0d36a57ec4896bcb74970f8fb24d8f3e17db133..0c8fe5b2500480c3a9e9ab3285ad22e0e599d953 100644
|
|
--- a/src/main/java/net/minecraft/network/protocol/PacketUtils.java
|
|
+++ b/src/main/java/net/minecraft/network/protocol/PacketUtils.java
|
|
@@ -32,7 +32,7 @@ public class PacketUtils {
|
|
if (listener instanceof ServerCommonPacketListenerImpl serverCommonPacketListener && serverCommonPacketListener.processedDisconnect) return; // CraftBukkit - Don't handle sync packets for kicked players
|
|
if (listener.shouldHandleMessage(packet)) {
|
|
co.aikar.timings.Timing timing = co.aikar.timings.MinecraftTimings.getPacketTiming(packet); // Paper - timings
|
|
- try (co.aikar.timings.Timing ignored = timing.startTiming()) { // Paper - timings
|
|
+ try { // Paper - timings // Purpur
|
|
packet.handle(listener);
|
|
} catch (Exception exception) {
|
|
if (exception instanceof ReportedException) {
|
|
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
|
|
index c3c5d392f1295e7edc0e96881f90f96cace5486f..9ab3a164c079721d2c4650ff0cf5aec82ada09bc 100644
|
|
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
|
|
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
|
|
@@ -1619,7 +1619,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
|
}
|
|
|
|
public void tickServer(BooleanSupplier shouldKeepTicking) {
|
|
- co.aikar.timings.TimingsManager.FULL_SERVER_TICK.startTiming(); // Paper
|
|
+ //co.aikar.timings.TimingsManager.FULL_SERVER_TICK.startTiming(); // Paper // Purpur
|
|
long i = Util.getNanos();
|
|
int j = this.pauseWhileEmptySeconds() * 20;
|
|
|
|
@@ -1643,11 +1643,11 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
|
}
|
|
|
|
// Paper start - move oversleep into full server tick
|
|
- isOversleep = true;MinecraftTimings.serverOversleep.startTiming();
|
|
+ //isOversleep = true;MinecraftTimings.serverOversleep.startTiming(); // Purpur
|
|
this.managedBlock(() -> {
|
|
return !this.canOversleep();
|
|
});
|
|
- isOversleep = false;MinecraftTimings.serverOversleep.stopTiming();
|
|
+ //isOversleep = false;MinecraftTimings.serverOversleep.stopTiming(); // Purpur
|
|
// Paper end
|
|
new com.destroystokyo.paper.event.server.ServerTickStartEvent(this.tickCount+1).callEvent(); // Paper - Server Tick Events
|
|
|
|
@@ -1667,9 +1667,9 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
|
ProfilerFiller gameprofilerfiller = Profiler.get();
|
|
|
|
// Paper start - move executeAll() into full server tick timing
|
|
- try (co.aikar.timings.Timing ignored = MinecraftTimings.processTasksTimer.startTiming()) {
|
|
+ //try (co.aikar.timings.Timing ignored = MinecraftTimings.processTasksTimer.startTiming()) { // Purpur
|
|
this.runAllTasks();
|
|
- }
|
|
+ //} // Purpur
|
|
// Paper end
|
|
// Paper start - Server Tick Events
|
|
long endTime = System.nanoTime();
|
|
@@ -1691,7 +1691,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
|
// Paper end - Add tick times API and /mspt command
|
|
this.logTickMethodTime(i);
|
|
gameprofilerfiller.pop();
|
|
- co.aikar.timings.TimingsManager.FULL_SERVER_TICK.stopTiming(); // Paper
|
|
+ //co.aikar.timings.TimingsManager.FULL_SERVER_TICK.stopTiming(); // Paper // Purpur
|
|
}
|
|
|
|
private void autoSave() {
|
|
@@ -1775,9 +1775,9 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
|
this.getPlayerList().getPlayers().forEach((entityplayer) -> {
|
|
entityplayer.connection.suspendFlushing();
|
|
});
|
|
- MinecraftTimings.bukkitSchedulerTimer.startTiming(); // Spigot // Paper
|
|
+ //MinecraftTimings.bukkitSchedulerTimer.startTiming(); // Spigot // Paper // Purpur
|
|
this.server.getScheduler().mainThreadHeartbeat(); // CraftBukkit
|
|
- MinecraftTimings.bukkitSchedulerTimer.stopTiming(); // Spigot // Paper
|
|
+ //MinecraftTimings.bukkitSchedulerTimer.stopTiming(); // Spigot // Paper // Purpur
|
|
// Paper start - Folia scheduler API
|
|
((io.papermc.paper.threadedregions.scheduler.FoliaGlobalRegionScheduler) Bukkit.getGlobalRegionScheduler()).tick();
|
|
getAllLevels().forEach(level -> {
|
|
@@ -1794,21 +1794,21 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
|
// Paper end - Folia scheduler API
|
|
io.papermc.paper.adventure.providers.ClickCallbackProviderImpl.CALLBACK_MANAGER.handleQueue(this.tickCount); // Paper
|
|
gameprofilerfiller.push("commandFunctions");
|
|
- MinecraftTimings.commandFunctionsTimer.startTiming(); // Spigot // Paper
|
|
+ //MinecraftTimings.commandFunctionsTimer.startTiming(); // Spigot // Paper // Purpur
|
|
this.getFunctions().tick();
|
|
- MinecraftTimings.commandFunctionsTimer.stopTiming(); // Spigot // Paper
|
|
+ //MinecraftTimings.commandFunctionsTimer.stopTiming(); // Spigot // Paper // Purpur
|
|
gameprofilerfiller.popPush("levels");
|
|
//Iterator iterator = this.getAllLevels().iterator(); // Paper - Throw exception on world create while being ticked; moved down
|
|
|
|
// CraftBukkit start
|
|
// Run tasks that are waiting on processing
|
|
- MinecraftTimings.processQueueTimer.startTiming(); // Spigot
|
|
+ //MinecraftTimings.processQueueTimer.startTiming(); // Spigot // Purpur
|
|
while (!this.processQueue.isEmpty()) {
|
|
this.processQueue.remove().run();
|
|
}
|
|
- MinecraftTimings.processQueueTimer.stopTiming(); // Spigot
|
|
+ //MinecraftTimings.processQueueTimer.stopTiming(); // Spigot // Purpur
|
|
|
|
- MinecraftTimings.timeUpdateTimer.startTiming(); // Spigot // Paper
|
|
+ //MinecraftTimings.timeUpdateTimer.startTiming(); // Spigot // Paper // Purpur
|
|
// Send time updates to everyone, it will get the right time from the world the player is in.
|
|
// Paper start - Perf: Optimize time updates
|
|
for (final ServerLevel level : this.getAllLevels()) {
|
|
@@ -1828,7 +1828,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
|
}
|
|
}
|
|
// Paper end - Perf: Optimize time updates
|
|
- MinecraftTimings.timeUpdateTimer.stopTiming(); // Spigot // Paper
|
|
+ //MinecraftTimings.timeUpdateTimer.stopTiming(); // Spigot // Paper // Purpur
|
|
|
|
this.isIteratingOverLevels = true; // Paper - Throw exception on world create while being ticked
|
|
Iterator iterator = this.getAllLevels().iterator(); // Paper - Throw exception on world create while being ticked; move down
|
|
@@ -1855,9 +1855,9 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
|
gameprofilerfiller.push("tick");
|
|
|
|
try {
|
|
- worldserver.timings.doTick.startTiming(); // Spigot
|
|
+ //worldserver.timings.doTick.startTiming(); // Spigot // Purpur
|
|
worldserver.tick(shouldKeepTicking);
|
|
- worldserver.timings.doTick.stopTiming(); // Spigot
|
|
+ //worldserver.timings.doTick.stopTiming(); // Spigot // Purpur
|
|
} catch (Throwable throwable) {
|
|
CrashReport crashreport = CrashReport.forThrowable(throwable, "Exception ticking world");
|
|
|
|
@@ -1871,24 +1871,24 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
|
this.isIteratingOverLevels = false; // Paper - Throw exception on world create while being ticked
|
|
|
|
gameprofilerfiller.popPush("connection");
|
|
- MinecraftTimings.connectionTimer.startTiming(); // Spigot // Paper
|
|
+ // MinecraftTimings.connectionTimer.startTiming(); // Spigot // Paper // Purpur
|
|
this.tickConnection();
|
|
- MinecraftTimings.connectionTimer.stopTiming(); // Spigot // Paper
|
|
+ // MinecraftTimings.connectionTimer.stopTiming(); // Spigot // Paper // Purpur
|
|
gameprofilerfiller.popPush("players");
|
|
- MinecraftTimings.playerListTimer.startTiming(); // Spigot // Paper
|
|
+ //MinecraftTimings.playerListTimer.startTiming(); // Spigot // Paper // Purpur
|
|
this.playerList.tick();
|
|
- MinecraftTimings.playerListTimer.stopTiming(); // Spigot // Paper
|
|
+ //MinecraftTimings.playerListTimer.stopTiming(); // Spigot // Paper // Purpur
|
|
if (SharedConstants.IS_RUNNING_IN_IDE && this.tickRateManager.runsNormally()) {
|
|
GameTestTicker.SINGLETON.tick();
|
|
}
|
|
|
|
gameprofilerfiller.popPush("server gui refresh");
|
|
|
|
- MinecraftTimings.tickablesTimer.startTiming(); // Spigot // Paper
|
|
+ //MinecraftTimings.tickablesTimer.startTiming(); // Spigot // Paper // Purpur
|
|
for (int i = 0; i < this.tickables.size(); ++i) {
|
|
((Runnable) this.tickables.get(i)).run();
|
|
}
|
|
- MinecraftTimings.tickablesTimer.stopTiming(); // Spigot // Paper
|
|
+ //MinecraftTimings.tickablesTimer.stopTiming(); // Spigot // Paper // Purpur
|
|
|
|
gameprofilerfiller.popPush("send chunks");
|
|
iterator = this.playerList.getPlayers().iterator();
|
|
diff --git a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
|
|
index 136ac58eef2c243650ffb390459d6959b90d5202..51abda23e30e56d79b3e020d0407c1cfe25d8ab9 100644
|
|
--- a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
|
|
+++ b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
|
|
@@ -524,7 +524,7 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface
|
|
}
|
|
|
|
public void handleConsoleInputs() {
|
|
- MinecraftTimings.serverCommandTimer.startTiming(); // Spigot
|
|
+ //MinecraftTimings.serverCommandTimer.startTiming(); // Spigot // Purpur
|
|
// Paper start - Perf: use proper queue
|
|
ConsoleInput servercommand;
|
|
while ((servercommand = this.serverCommandQueue.poll()) != null) {
|
|
@@ -541,7 +541,7 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface
|
|
// CraftBukkit end
|
|
}
|
|
|
|
- MinecraftTimings.serverCommandTimer.stopTiming(); // Spigot
|
|
+ //MinecraftTimings.serverCommandTimer.stopTiming(); // Spigot // Purpur
|
|
}
|
|
|
|
@Override
|
|
diff --git a/src/main/java/net/minecraft/server/level/ChunkMap.java b/src/main/java/net/minecraft/server/level/ChunkMap.java
|
|
index d692af061ded8cd5bcf1d268e6bd521d84f99c39..987d8567034e06bfb916d3e0a4a87f6c9169bccf 100644
|
|
--- a/src/main/java/net/minecraft/server/level/ChunkMap.java
|
|
+++ b/src/main/java/net/minecraft/server/level/ChunkMap.java
|
|
@@ -961,7 +961,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
|
|
List<ServerPlayer> list = Lists.newArrayList();
|
|
List<ServerPlayer> list1 = this.level.players();
|
|
ObjectIterator objectiterator = this.entityMap.values().iterator();
|
|
- level.timings.tracker1.startTiming(); // Paper
|
|
+ //this.level.timings.tracker1.startTiming(); // Paper // Purpur
|
|
|
|
ChunkMap.TrackedEntity playerchunkmap_entitytracker;
|
|
|
|
@@ -986,17 +986,17 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
|
|
playerchunkmap_entitytracker.serverEntity.sendChanges();
|
|
}
|
|
}
|
|
- level.timings.tracker1.stopTiming(); // Paper
|
|
+ //this.level.timings.tracker1.stopTiming(); // Paper // Purpur
|
|
|
|
if (!list.isEmpty()) {
|
|
objectiterator = this.entityMap.values().iterator();
|
|
|
|
- level.timings.tracker2.startTiming(); // Paper
|
|
+ //this.level.timings.tracker2.startTiming(); // Paper // Purpur
|
|
while (objectiterator.hasNext()) {
|
|
playerchunkmap_entitytracker = (ChunkMap.TrackedEntity) objectiterator.next();
|
|
playerchunkmap_entitytracker.updatePlayers(list);
|
|
}
|
|
- level.timings.tracker2.stopTiming(); // Paper
|
|
+ //this.level.timings.tracker2.stopTiming(); // Paper // Purpur
|
|
}
|
|
|
|
}
|
|
diff --git a/src/main/java/net/minecraft/server/level/ServerChunkCache.java b/src/main/java/net/minecraft/server/level/ServerChunkCache.java
|
|
index 4b5985c284faac7b06c0f99d53065f5060ecff4a..96f9d18eb22380cccd35b486713583d6dfa46646 100644
|
|
--- a/src/main/java/net/minecraft/server/level/ServerChunkCache.java
|
|
+++ b/src/main/java/net/minecraft/server/level/ServerChunkCache.java
|
|
@@ -423,9 +423,9 @@ public class ServerChunkCache extends ChunkSource implements ca.spottedleaf.moon
|
|
|
|
public void save(boolean flush) {
|
|
// Paper - rewrite chunk system
|
|
- try (co.aikar.timings.Timing timed = level.timings.chunkSaveData.startTiming()) { // Paper - Timings
|
|
+ //try (co.aikar.timings.Timing timed = level.timings.chunkSaveData.startTiming()) { // Paper - Timings // Purpur
|
|
this.chunkMap.saveAllChunks(flush);
|
|
- } // Paper - Timings
|
|
+ //} // Paper - Timings // Purpur
|
|
}
|
|
|
|
@Override
|
|
@@ -461,26 +461,25 @@ public class ServerChunkCache extends ChunkSource implements ca.spottedleaf.moon
|
|
ProfilerFiller gameprofilerfiller = Profiler.get();
|
|
|
|
gameprofilerfiller.push("purge");
|
|
- this.level.timings.doChunkMap.startTiming(); // Spigot
|
|
+ //this.level.timings.doChunkMap.startTiming(); // Spigot // Purpur
|
|
if (this.level.tickRateManager().runsNormally() || !tickChunks || this.level.spigotConfig.unloadFrozenChunks) { // Spigot
|
|
this.distanceManager.purgeStaleTickets();
|
|
}
|
|
-
|
|
this.runDistanceManagerUpdates();
|
|
- this.level.timings.doChunkMap.stopTiming(); // Spigot
|
|
+ //this.level.timings.doChunkMap.stopTiming(); // Spigot // Purpur
|
|
gameprofilerfiller.popPush("chunks");
|
|
if (tickChunks) {
|
|
- this.level.timings.chunks.startTiming(); // Paper - timings
|
|
+ //this.level.timings.chunks.startTiming(); // Paper - timings // Purpur
|
|
((ca.spottedleaf.moonrise.patches.chunk_system.level.ChunkSystemServerLevel)this.level).moonrise$getPlayerChunkLoader().tick(); // Paper - rewrite chunk system
|
|
this.tickChunks();
|
|
- this.level.timings.chunks.stopTiming(); // Paper - timings
|
|
+ //this.level.timings.chunks.stopTiming(); // Paper - timings // Purpur
|
|
this.chunkMap.tick();
|
|
}
|
|
|
|
- this.level.timings.doChunkUnload.startTiming(); // Spigot
|
|
+ //this.level.timings.doChunkUnload.startTiming(); // Spigot // Purpur
|
|
gameprofilerfiller.popPush("unload");
|
|
this.chunkMap.tick(shouldKeepTicking);
|
|
- this.level.timings.doChunkUnload.stopTiming(); // Spigot
|
|
+ //this.level.timings.doChunkUnload.stopTiming(); // Spigot // Purpur
|
|
gameprofilerfiller.pop();
|
|
this.clearCache();
|
|
}
|
|
@@ -561,10 +560,10 @@ public class ServerChunkCache extends ChunkSource implements ca.spottedleaf.moon
|
|
|
|
private void tickChunks(ProfilerFiller profiler, long timeDelta, List<LevelChunk> chunks) {
|
|
profiler.popPush("naturalSpawnCount");
|
|
- this.level.timings.countNaturalMobs.startTiming(); // Paper - timings
|
|
+ //this.level.timings.countNaturalMobs.startTiming(); // Paper - timings // Purpur
|
|
int j = this.distanceManager.getNaturalSpawnChunkCount();
|
|
NaturalSpawner.SpawnState spawnercreature_d = NaturalSpawner.createState(j, this.level.getAllEntities(), this::getFullChunk, new LocalMobCapCalculator(this.chunkMap));
|
|
- this.level.timings.countNaturalMobs.stopTiming(); // Paper - timings
|
|
+ // this.level.timings.countNaturalMobs.stopTiming(); // Paper - timings // Purpur
|
|
|
|
this.lastSpawnState = spawnercreature_d;
|
|
profiler.popPush("spawnAndTick");
|
|
@@ -605,13 +604,13 @@ public class ServerChunkCache extends ChunkSource implements ca.spottedleaf.moon
|
|
}
|
|
}
|
|
|
|
- this.level.timings.chunkTicks.stopTiming(); // Paper
|
|
+ //this.level.timings.chunkTicks.stopTiming(); // Paper // Purpur
|
|
|
|
profiler.popPush("customSpawners");
|
|
if (flag) {
|
|
- try (co.aikar.timings.Timing ignored = this.level.timings.miscMobSpawning.startTiming()) { // Paper - timings
|
|
+ //try (co.aikar.timings.Timing ignored = this.level.timings.miscMobSpawning.startTiming()) { // Paper - timings // Purpur
|
|
this.level.tickCustomSpawners(this.spawnEnemies, this.spawnFriendlies);
|
|
- }
|
|
+ //} // Purpur
|
|
}
|
|
|
|
}
|
|
diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java
|
|
index f2bf1a9856fb1200f750b06b64e83b1b12e4068d..6e4ca03d66d870cca45aef1e49c18a470ebd7dc0 100644
|
|
--- a/src/main/java/net/minecraft/server/level/ServerLevel.java
|
|
+++ b/src/main/java/net/minecraft/server/level/ServerLevel.java
|
|
@@ -757,7 +757,7 @@ public class ServerLevel extends Level implements ServerEntityGetter, WorldGenLe
|
|
}
|
|
|
|
gameprofilerfiller.push("tickPending");
|
|
- this.timings.scheduledBlocks.startTiming(); // Paper
|
|
+ //this.timings.scheduledBlocks.startTiming(); // Paper // Purpur
|
|
if (!this.isDebug() && flag) {
|
|
j = this.getGameTime();
|
|
gameprofilerfiller.push("blockTicks");
|
|
@@ -766,24 +766,24 @@ public class ServerLevel extends Level implements ServerEntityGetter, WorldGenLe
|
|
this.fluidTicks.tick(j, paperConfig().environment.maxFluidTicks, this::tickFluid); // Paper - configurable max fluid ticks
|
|
gameprofilerfiller.pop();
|
|
}
|
|
- this.timings.scheduledBlocks.stopTiming(); // Paper
|
|
+ //this.timings.scheduledBlocks.stopTiming(); // Paper // Purpur
|
|
|
|
gameprofilerfiller.popPush("raid");
|
|
if (flag) {
|
|
- this.timings.raids.startTiming(); // Paper - timings
|
|
+ // this.timings.raids.startTiming(); // Paper - timings // Purpur
|
|
this.raids.tick();
|
|
- this.timings.raids.stopTiming(); // Paper - timings
|
|
+ // this.timings.raids.stopTiming(); // Paper - timings // Purpur
|
|
}
|
|
|
|
gameprofilerfiller.popPush("chunkSource");
|
|
- this.timings.chunkProviderTick.startTiming(); // Paper - timings
|
|
+ //this.timings.chunkProviderTick.startTiming(); // Paper - timings // Purpur
|
|
this.getChunkSource().tick(shouldKeepTicking, true);
|
|
- this.timings.chunkProviderTick.stopTiming(); // Paper - timings
|
|
+ //this.timings.chunkProviderTick.stopTiming(); // Paper - timings // Purpur
|
|
gameprofilerfiller.popPush("blockEvents");
|
|
if (flag) {
|
|
- this.timings.doSounds.startTiming(); // Spigot
|
|
+ // this.timings.doSounds.startTiming(); // Spigot // Purpur
|
|
this.runBlockEvents();
|
|
- this.timings.doSounds.stopTiming(); // Spigot
|
|
+ // this.timings.doSounds.stopTiming(); // Spigot // Purpur
|
|
}
|
|
|
|
this.handlingTick = false;
|
|
@@ -796,7 +796,7 @@ public class ServerLevel extends Level implements ServerEntityGetter, WorldGenLe
|
|
|
|
if (flag1 || this.emptyTime++ < 300) {
|
|
gameprofilerfiller.push("entities");
|
|
- this.timings.tickEntities.startTiming(); // Spigot
|
|
+ //this.timings.tickEntities.startTiming(); // Spigot // Purpur
|
|
if (this.dragonFight != null && flag) {
|
|
gameprofilerfiller.push("dragonFight");
|
|
this.dragonFight.tick();
|
|
@@ -804,7 +804,7 @@ public class ServerLevel extends Level implements ServerEntityGetter, WorldGenLe
|
|
}
|
|
|
|
org.spigotmc.ActivationRange.activateEntities(this); // Spigot
|
|
- this.timings.entityTick.startTiming(); // Spigot
|
|
+ //this.timings.entityTick.startTiming(); // Spigot // Purpur
|
|
this.entityTickList.forEach((entity) -> {
|
|
if (!entity.isRemoved()) {
|
|
if (!tickratemanager.isEntityFrozen(entity)) {
|
|
@@ -829,8 +829,8 @@ public class ServerLevel extends Level implements ServerEntityGetter, WorldGenLe
|
|
}
|
|
}
|
|
});
|
|
- this.timings.entityTick.stopTiming(); // Spigot
|
|
- this.timings.tickEntities.stopTiming(); // Spigot
|
|
+ //this.timings.entityTick.stopTiming(); // Spigot // Purpur
|
|
+ //this.timings.tickEntities.stopTiming(); // Spigot // Purpur
|
|
gameprofilerfiller.pop();
|
|
this.tickBlockEntities();
|
|
}
|
|
@@ -1014,12 +1014,12 @@ public class ServerLevel extends Level implements ServerEntityGetter, WorldGenLe
|
|
} // Paper - Option to disable ice and snow
|
|
|
|
gameprofilerfiller.popPush("tickBlocks");
|
|
- timings.chunkTicksBlocks.startTiming(); // Paper
|
|
+ //timings.chunkTicksBlocks.startTiming(); // Paper // Purpur
|
|
if (randomTickSpeed > 0) {
|
|
this.optimiseRandomTick(chunk, randomTickSpeed); // Paper - optimise random ticking
|
|
}
|
|
|
|
- timings.chunkTicksBlocks.stopTiming(); // Paper
|
|
+ //timings.chunkTicksBlocks.stopTiming(); // Paper // Purpur
|
|
gameprofilerfiller.pop();
|
|
}
|
|
|
|
@@ -1344,8 +1344,8 @@ public class ServerLevel extends Level implements ServerEntityGetter, WorldGenLe
|
|
// Spigot end
|
|
// Paper start- timings
|
|
final boolean isActive = org.spigotmc.ActivationRange.checkIfActive(entity);
|
|
- timer = isActive ? entity.getType().tickTimer.startTiming() : entity.getType().inactiveTickTimer.startTiming(); // Paper
|
|
- try {
|
|
+ //timer = isActive ? entity.getType().tickTimer.startTiming() : entity.getType().inactiveTickTimer.startTiming(); // Paper // Purpur
|
|
+ //try { // Purpur
|
|
// Paper end - timings
|
|
entity.setOldPosAndRot();
|
|
ProfilerFiller gameprofilerfiller = Profiler.get();
|
|
@@ -1360,7 +1360,7 @@ public class ServerLevel extends Level implements ServerEntityGetter, WorldGenLe
|
|
entity.postTick(); // CraftBukkit
|
|
} else { entity.inactiveTick(); } // Paper - EAR 2
|
|
gameprofilerfiller.pop();
|
|
- } finally { timer.stopTiming(); } // Paper - timings // EAR 2
|
|
+ //} finally { timer.stopTiming(); } // Paper - timings // EAR 2 // Purpur
|
|
Iterator iterator = entity.getPassengers().iterator();
|
|
|
|
while (iterator.hasNext()) {
|
|
@@ -1424,7 +1424,7 @@ public class ServerLevel extends Level implements ServerEntityGetter, WorldGenLe
|
|
|
|
if (!savingDisabled) {
|
|
org.bukkit.Bukkit.getPluginManager().callEvent(new org.bukkit.event.world.WorldSaveEvent(this.getWorld())); // CraftBukkit
|
|
- try (co.aikar.timings.Timing ignored = timings.worldSave.startTiming()) { // Paper
|
|
+ //try (co.aikar.timings.Timing ignored = timings.worldSave.startTiming()) { // Paper // Purpur // Purpur
|
|
if (progressListener != null) {
|
|
progressListener.progressStartNoAbort(Component.translatable("menu.savingLevel"));
|
|
}
|
|
@@ -1434,10 +1434,10 @@ public class ServerLevel extends Level implements ServerEntityGetter, WorldGenLe
|
|
progressListener.progressStage(Component.translatable("menu.savingChunks"));
|
|
}
|
|
|
|
- timings.worldSaveChunks.startTiming(); // Paper
|
|
+ //timings.worldSaveChunks.startTiming(); // Paper // Purpur
|
|
if (!close) { chunkproviderserver.save(flush); } // Paper - add close param
|
|
- timings.worldSaveChunks.stopTiming(); // Paper
|
|
- }// Paper
|
|
+ //timings.worldSaveChunks.stopTiming(); // Paper // Purpur
|
|
+ //}// Paper // Purpur
|
|
// Paper - rewrite chunk system
|
|
|
|
}
|
|
diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java
|
|
index a170b6b357987d6e1cb42a9b54a2b8d965395db6..988490d84188e61ce716506585c80c85e59c692a 100644
|
|
--- a/src/main/java/net/minecraft/server/players/PlayerList.java
|
|
+++ b/src/main/java/net/minecraft/server/players/PlayerList.java
|
|
@@ -1192,11 +1192,11 @@ public abstract class PlayerList {
|
|
|
|
public void saveAll() {
|
|
io.papermc.paper.util.MCUtil.ensureMain("Save Players" , () -> { // Paper - Ensure main
|
|
- MinecraftTimings.savePlayers.startTiming(); // Paper
|
|
+ //MinecraftTimings.savePlayers.startTiming(); // Paper // Purpur
|
|
for (int i = 0; i < this.players.size(); ++i) {
|
|
this.save(this.players.get(i));
|
|
}
|
|
- MinecraftTimings.savePlayers.stopTiming(); // Paper
|
|
+ //MinecraftTimings.savePlayers.stopTiming(); // Paper // Purpur
|
|
return null; }); // Paper - ensure main
|
|
}
|
|
|
|
diff --git a/src/main/java/net/minecraft/world/entity/ai/behavior/Behavior.java b/src/main/java/net/minecraft/world/entity/ai/behavior/Behavior.java
|
|
index 9379dd4056018b52c93ed4888dcdc94579bd9691..612a14806ec63b0dcf31814396282f4b7f4a527c 100644
|
|
--- a/src/main/java/net/minecraft/world/entity/ai/behavior/Behavior.java
|
|
+++ b/src/main/java/net/minecraft/world/entity/ai/behavior/Behavior.java
|
|
@@ -59,9 +59,9 @@ public abstract class Behavior<E extends LivingEntity> implements BehaviorContro
|
|
this.status = Behavior.Status.RUNNING;
|
|
int i = this.minDuration + world.getRandom().nextInt(this.maxDuration + 1 - this.minDuration);
|
|
this.endTimestamp = time + (long)i;
|
|
- this.timing.startTiming(); // Paper - behavior timings
|
|
+ //this.timing.startTiming(); // Paper - behavior timings // Purpur
|
|
this.start(world, entity, time);
|
|
- this.timing.stopTiming(); // Paper - behavior timings
|
|
+ //this.timing.stopTiming(); // Paper - behavior timings // Purpur
|
|
return true;
|
|
} else {
|
|
return false;
|
|
@@ -73,13 +73,13 @@ public abstract class Behavior<E extends LivingEntity> implements BehaviorContro
|
|
|
|
@Override
|
|
public final void tickOrStop(ServerLevel world, E entity, long time) {
|
|
- this.timing.startTiming(); // Paper - behavior timings
|
|
+ //this.timing.startTiming(); // Paper - behavior timings // Purpur
|
|
if (!this.timedOut(time) && this.canStillUse(world, entity, time)) {
|
|
this.tick(world, entity, time);
|
|
} else {
|
|
this.doStop(world, entity, time);
|
|
}
|
|
- this.timing.stopTiming(); // Paper - behavior timings
|
|
+ //this.timing.stopTiming(); // Paper - behavior timings // Purpur
|
|
}
|
|
|
|
protected void tick(ServerLevel world, E entity, long time) {
|
|
diff --git a/src/main/java/net/minecraft/world/entity/ai/sensing/Sensor.java b/src/main/java/net/minecraft/world/entity/ai/sensing/Sensor.java
|
|
index 8bc7979fb9c2a796921a2a279b78294809f2ed03..043e078f2c108d9ff77d3b21f96a6a106bcea51d 100644
|
|
--- a/src/main/java/net/minecraft/world/entity/ai/sensing/Sensor.java
|
|
+++ b/src/main/java/net/minecraft/world/entity/ai/sensing/Sensor.java
|
|
@@ -56,11 +56,11 @@ public abstract class Sensor<E extends LivingEntity> {
|
|
if (--this.timeToTick <= 0L) {
|
|
// Paper start - configurable sensor tick rate and timings
|
|
this.timeToTick = java.util.Objects.requireNonNullElse(world.paperConfig().tickRates.sensor.get(entity.getType(), this.configKey), this.scanRate);
|
|
- this.timing.startTiming();
|
|
+ //this.timing.startTiming(); // Purpur
|
|
this.updateTargetingConditionRanges(entity);
|
|
// Paper end
|
|
this.doTick(world, entity);
|
|
- this.timing.stopTiming(); // Paper - sensor timings
|
|
+ //this.timing.stopTiming(); // Paper - sensor timings // Purpur
|
|
}
|
|
}
|
|
|
|
diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java
|
|
index 85ae5c9c873dab19f897fe50b70c62e3c094bd42..5a8b02d93f3d7eb882e93c9698858e7ae55c79e6 100644
|
|
--- a/src/main/java/net/minecraft/world/level/Level.java
|
|
+++ b/src/main/java/net/minecraft/world/level/Level.java
|
|
@@ -1491,15 +1491,15 @@ public abstract class Level implements LevelAccessor, AutoCloseable, ca.spottedl
|
|
ProfilerFiller gameprofilerfiller = Profiler.get();
|
|
|
|
gameprofilerfiller.push("blockEntities");
|
|
- this.timings.tileEntityPending.startTiming(); // Spigot
|
|
+ //this.timings.tileEntityPending.startTiming(); // Spigot // Purpur
|
|
this.tickingBlockEntities = true;
|
|
if (!this.pendingBlockEntityTickers.isEmpty()) {
|
|
this.blockEntityTickers.addAll(this.pendingBlockEntityTickers);
|
|
this.pendingBlockEntityTickers.clear();
|
|
}
|
|
- this.timings.tileEntityPending.stopTiming(); // Spigot
|
|
+ //this.timings.tileEntityPending.stopTiming(); // Spigot // Purpur
|
|
|
|
- this.timings.tileEntityTick.startTiming(); // Spigot
|
|
+ //this.timings.tileEntityTick.startTiming(); // Spigot // Purpur
|
|
// Spigot start
|
|
// Iterator<TickingBlockEntity> iterator = this.blockEntityTickers.iterator();
|
|
boolean flag = this.tickRateManager().runsNormally();
|
|
@@ -1530,7 +1530,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable, ca.spottedl
|
|
}
|
|
this.blockEntityTickers.removeAll(toRemove); // Paper - Fix MC-117075
|
|
|
|
- this.timings.tileEntityTick.stopTiming(); // Spigot
|
|
+ //this.timings.tileEntityTick.stopTiming(); // Spigot // Purpur
|
|
this.tickingBlockEntities = false;
|
|
co.aikar.timings.TimingHistory.tileEntityTicks += this.blockEntityTickers.size(); // Paper
|
|
gameprofilerfiller.pop();
|
|
diff --git a/src/main/java/net/minecraft/world/level/NaturalSpawner.java b/src/main/java/net/minecraft/world/level/NaturalSpawner.java
|
|
index 6eb69ebe688c1c52d5a5986dfc63cdd42e66687e..f6fb4892c95f9716628ed8a90d1560b7c0a2e032 100644
|
|
--- a/src/main/java/net/minecraft/world/level/NaturalSpawner.java
|
|
+++ b/src/main/java/net/minecraft/world/level/NaturalSpawner.java
|
|
@@ -155,7 +155,7 @@ public final class NaturalSpawner {
|
|
ProfilerFiller gameprofilerfiller = Profiler.get();
|
|
|
|
gameprofilerfiller.push("spawner");
|
|
- world.timings.mobSpawn.startTiming(); // Spigot
|
|
+ //world.timings.mobSpawn.startTiming(); // Spigot // Purpur
|
|
Iterator iterator = spawnableGroups.iterator();
|
|
|
|
while (iterator.hasNext()) {
|
|
@@ -170,7 +170,7 @@ public final class NaturalSpawner {
|
|
}
|
|
}
|
|
|
|
- world.timings.mobSpawn.stopTiming(); // Spigot
|
|
+ //world.timings.mobSpawn.stopTiming(); // Spigot // Purpur
|
|
gameprofilerfiller.pop();
|
|
}
|
|
|
|
diff --git a/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java b/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java
|
|
index e03d57f58a9f962cd429e8851fb3f35f3491e2c0..a1a5b34b059d3beaa042f8f2d0ba509191df6f15 100644
|
|
--- a/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java
|
|
+++ b/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java
|
|
@@ -691,7 +691,7 @@ public class LevelChunk extends ChunkAccess implements ca.spottedleaf.moonrise.p
|
|
org.bukkit.craftbukkit.event.CraftEventFactory.callEntitiesLoadEvent(this.level, this.chunkPos, ((ca.spottedleaf.moonrise.patches.chunk_system.level.ChunkSystemServerLevel)this.level).moonrise$getChunkTaskScheduler().chunkHolderManager.getChunkHolder(this.locX, this.locZ).getEntityChunk().getAllEntities()); // Paper - rewrite chunk system
|
|
|
|
if (this.needsDecoration) {
|
|
- try (co.aikar.timings.Timing ignored = this.level.timings.chunkLoadPopulate.startTiming()) { // Paper
|
|
+ //try (co.aikar.timings.Timing ignored = this.level.timings.chunkLoadPopulate.startTiming()) { // Paper // Purpur
|
|
this.needsDecoration = false;
|
|
java.util.Random random = new java.util.Random();
|
|
random.setSeed(this.level.getSeed());
|
|
@@ -711,7 +711,7 @@ public class LevelChunk extends ChunkAccess implements ca.spottedleaf.moonrise.p
|
|
}
|
|
}
|
|
server.getPluginManager().callEvent(new org.bukkit.event.world.ChunkPopulateEvent(bukkitChunk));
|
|
- } // Paper
|
|
+ //} // Paper // Purpur
|
|
}
|
|
}
|
|
}
|
|
@@ -1063,7 +1063,7 @@ public class LevelChunk extends ChunkAccess implements ca.spottedleaf.moonrise.p
|
|
ProfilerFiller gameprofilerfiller = Profiler.get();
|
|
|
|
gameprofilerfiller.push(this::getType);
|
|
- this.blockEntity.tickTimer.startTiming(); // Spigot
|
|
+ //this.blockEntity.tickTimer.startTiming(); // Spigot // Purpur
|
|
BlockState iblockdata = LevelChunk.this.getBlockState(blockposition);
|
|
|
|
if (this.blockEntity.getType().isValid(iblockdata)) {
|
|
@@ -1089,7 +1089,7 @@ public class LevelChunk extends ChunkAccess implements ca.spottedleaf.moonrise.p
|
|
// Paper end - Prevent block entity and entity crashes
|
|
// Spigot start
|
|
} finally {
|
|
- this.blockEntity.tickTimer.stopTiming();
|
|
+ //this.blockEntity.tickTimer.stopTiming(); // Purpur
|
|
// Spigot end
|
|
}
|
|
}
|
|
diff --git a/src/main/java/org/bukkit/craftbukkit/scheduler/CraftScheduler.java b/src/main/java/org/bukkit/craftbukkit/scheduler/CraftScheduler.java
|
|
index 4178f48c1614af8e6796cf07fd018b9c6e67dcd0..c8eb39afabf6953c248b4d1dd4cac9948283aa47 100644
|
|
--- a/src/main/java/org/bukkit/craftbukkit/scheduler/CraftScheduler.java
|
|
+++ b/src/main/java/org/bukkit/craftbukkit/scheduler/CraftScheduler.java
|
|
@@ -504,10 +504,10 @@ public class CraftScheduler implements BukkitScheduler {
|
|
this.runners.remove(task.getTaskId());
|
|
}
|
|
}
|
|
- MinecraftTimings.bukkitSchedulerFinishTimer.startTiming(); // Paper
|
|
+ //MinecraftTimings.bukkitSchedulerFinishTimer.startTiming(); // Paper // Purpur
|
|
this.pending.addAll(temp);
|
|
temp.clear();
|
|
- MinecraftTimings.bukkitSchedulerFinishTimer.stopTiming(); // Paper
|
|
+ //MinecraftTimings.bukkitSchedulerFinishTimer.stopTiming(); // Paper // Purpur
|
|
//this.debugHead = this.debugHead.getNextHead(this.currentTick); // Paper
|
|
}
|
|
|
|
@@ -550,7 +550,7 @@ public class CraftScheduler implements BukkitScheduler {
|
|
}
|
|
|
|
void parsePending() { // Paper
|
|
- if (!this.isAsyncScheduler) MinecraftTimings.bukkitSchedulerPendingTimer.startTiming(); // Paper
|
|
+ //if (!this.isAsyncScheduler) MinecraftTimings.bukkitSchedulerPendingTimer.startTiming(); // Paper // Purpur
|
|
CraftTask head = this.head;
|
|
CraftTask task = head.getNext();
|
|
CraftTask lastTask = head;
|
|
@@ -569,7 +569,7 @@ public class CraftScheduler implements BukkitScheduler {
|
|
task.setNext(null);
|
|
}
|
|
this.head = lastTask;
|
|
- if (!this.isAsyncScheduler) MinecraftTimings.bukkitSchedulerPendingTimer.stopTiming(); // Paper
|
|
+ //if (!this.isAsyncScheduler) MinecraftTimings.bukkitSchedulerPendingTimer.stopTiming(); // Paper // Purpur
|
|
}
|
|
|
|
private boolean isReady(final int currentTick) {
|
|
diff --git a/src/main/java/org/bukkit/craftbukkit/scheduler/CraftTask.java b/src/main/java/org/bukkit/craftbukkit/scheduler/CraftTask.java
|
|
index ba369f3dcfdf498e971dc4405d39657a9b6e97cc..8f181e03eda734b18f8c9ee80ee6e45f8689d178 100644
|
|
--- a/src/main/java/org/bukkit/craftbukkit/scheduler/CraftTask.java
|
|
+++ b/src/main/java/org/bukkit/craftbukkit/scheduler/CraftTask.java
|
|
@@ -81,13 +81,13 @@ public class CraftTask implements BukkitTask, Runnable { // Spigot
|
|
|
|
@Override
|
|
public void run() {
|
|
- try (Timing ignored = timings.startTiming()) { // Paper
|
|
+ //try (Timing ignored = timings.startTiming()) { // Paper // Purpur
|
|
if (this.rTask != null) {
|
|
this.rTask.run();
|
|
} else {
|
|
this.cTask.accept(this);
|
|
}
|
|
- } // Paper
|
|
+ //} // Paper // Purpur
|
|
}
|
|
|
|
long getCreatedAt() {
|
|
diff --git a/src/main/java/org/bukkit/craftbukkit/scoreboard/CraftScoreboardManager.java b/src/main/java/org/bukkit/craftbukkit/scoreboard/CraftScoreboardManager.java
|
|
index b3e1adeb932da9b3bed16acd94e2f16da48a7c72..d3ec817e95628f1fc8be4a29c9a0f13c7d5fd552 100644
|
|
--- a/src/main/java/org/bukkit/craftbukkit/scoreboard/CraftScoreboardManager.java
|
|
+++ b/src/main/java/org/bukkit/craftbukkit/scoreboard/CraftScoreboardManager.java
|
|
@@ -115,7 +115,7 @@ public final class CraftScoreboardManager implements ScoreboardManager {
|
|
public void forAllObjectives(ObjectiveCriteria criteria, ScoreHolder holder, Consumer<ScoreAccess> consumer) {
|
|
// Paper start - add timings for scoreboard search
|
|
// plugins leaking scoreboards will make this very expensive, let server owners debug it easily
|
|
- co.aikar.timings.MinecraftTimings.scoreboardScoreSearch.startTimingIfSync();
|
|
+ //co.aikar.timings.MinecraftTimings.scoreboardScoreSearch.startTimingIfSync(); // Purpur
|
|
try {
|
|
// Paper end - add timings for scoreboard search
|
|
for (CraftScoreboard scoreboard : this.scoreboards) {
|
|
@@ -123,7 +123,7 @@ public final class CraftScoreboardManager implements ScoreboardManager {
|
|
board.forAllObjectives(criteria, holder, (score) -> consumer.accept(score));
|
|
}
|
|
} finally { // Paper start - add timings for scoreboard search
|
|
- co.aikar.timings.MinecraftTimings.scoreboardScoreSearch.stopTimingIfSync();
|
|
+ //co.aikar.timings.MinecraftTimings.scoreboardScoreSearch.stopTimingIfSync(); // Purpur
|
|
}
|
|
// Paper end - add timings for scoreboard search
|
|
}
|
|
diff --git a/src/main/java/org/spigotmc/ActivationRange.java b/src/main/java/org/spigotmc/ActivationRange.java
|
|
index ca05c37dad39808683429276d85d970b7cc63f82..6936fa0d25377292a94ba694eaf50e4ea8277506 100644
|
|
--- a/src/main/java/org/spigotmc/ActivationRange.java
|
|
+++ b/src/main/java/org/spigotmc/ActivationRange.java
|
|
@@ -167,7 +167,7 @@ public class ActivationRange
|
|
*/
|
|
public static void activateEntities(Level world)
|
|
{
|
|
- MinecraftTimings.entityActivationCheckTimer.startTiming();
|
|
+ //MinecraftTimings.entityActivationCheckTimer.startTiming(); // Purpur
|
|
final int miscActivationRange = world.spigotConfig.miscActivationRange;
|
|
final int raiderActivationRange = world.spigotConfig.raiderActivationRange;
|
|
final int animalActivationRange = world.spigotConfig.animalActivationRange;
|
|
@@ -228,7 +228,7 @@ public class ActivationRange
|
|
}
|
|
// Paper end
|
|
}
|
|
- MinecraftTimings.entityActivationCheckTimer.stopTiming();
|
|
+ //MinecraftTimings.entityActivationCheckTimer.stopTiming(); // Purpur
|
|
}
|
|
|
|
/**
|