Places more unsafe timings
This commit is contained in:
@@ -21,7 +21,7 @@ import net.minecraft.server.WorldManager;
|
||||
public class AkarinWorldAccessor implements IWorldAccess {
|
||||
private final WorldManager worldManager;
|
||||
private final NavigationListener navigationListener;
|
||||
private IWorldAccess[] customAccessors;
|
||||
private IWorldAccess[] customAccessors = new IWorldAccess[0];
|
||||
private boolean hasCustomAccessor;
|
||||
|
||||
public void add(IWorldAccess worldAccessor) {
|
||||
|
||||
@@ -981,7 +981,7 @@ public class Chunk implements IChunkAccess {
|
||||
server.getPluginManager().callEvent(new org.bukkit.event.world.ChunkLoadEvent(this.bukkitChunk, this.needsDecoration));
|
||||
|
||||
if (this.needsDecoration) {
|
||||
this.world.timings.syncChunkLoadPopulateTimer.startTiming(); // Paper
|
||||
this.world.timings.syncChunkLoadPopulateTimer.startTimingUnsafe(); // Paper
|
||||
BlockSand.instaFall = true;
|
||||
java.util.Random random = new java.util.Random();
|
||||
random.setSeed(world.getSeed());
|
||||
@@ -1002,7 +1002,7 @@ public class Chunk implements IChunkAccess {
|
||||
}
|
||||
BlockSand.instaFall = false;
|
||||
server.getPluginManager().callEvent(new org.bukkit.event.world.ChunkPopulateEvent(bukkitChunk));
|
||||
this.world.timings.syncChunkLoadPopulateTimer.stopTiming(); // Paper
|
||||
this.world.timings.syncChunkLoadPopulateTimer.stopTimingUnsafe(); // Paper
|
||||
}
|
||||
}
|
||||
// CraftBukkit end
|
||||
|
||||
@@ -283,7 +283,7 @@ public class ChunkProviderServer implements IChunkProvider {
|
||||
}
|
||||
|
||||
public void saveChunk(IChunkAccess ichunkaccess, boolean unloaded) { // Spigot
|
||||
try (co.aikar.timings.Timing timed = world.timings.chunkSaveData.startTiming()) { // Paper - Timings
|
||||
try (co.aikar.timings.Timing timed = world.timings.chunkSaveData.startTimingUnsafe()) { // Paper - Timings
|
||||
ichunkaccess.setLastSaved(this.world.getTime());
|
||||
this.chunkLoader.saveChunk(this.world, ichunkaccess, unloaded); // Spigot
|
||||
} catch (IOException ioexception) {
|
||||
|
||||
@@ -467,7 +467,7 @@ public class DedicatedServer extends MinecraftServer implements IMinecraftServer
|
||||
}
|
||||
|
||||
public void handleCommandQueue() {
|
||||
MinecraftTimings.serverCommandTimer.startTiming(); // Spigot
|
||||
MinecraftTimings.serverCommandTimer.startTimingUnsafe(); // Spigot
|
||||
// Paper start - use proper queue
|
||||
ServerCommand servercommand;
|
||||
while ((servercommand = this.serverCommandQueue.poll()) != null) {
|
||||
@@ -484,7 +484,7 @@ public class DedicatedServer extends MinecraftServer implements IMinecraftServer
|
||||
// CraftBukkit end
|
||||
}
|
||||
|
||||
MinecraftTimings.serverCommandTimer.stopTiming(); // Spigot
|
||||
MinecraftTimings.serverCommandTimer.stopTimingUnsafe(); // Spigot
|
||||
}
|
||||
|
||||
public boolean Q() {
|
||||
|
||||
@@ -168,7 +168,7 @@ public class EntityTracker {
|
||||
public void updatePlayers() {
|
||||
List<EntityPlayer> list = Lists.newArrayList();
|
||||
Iterator iterator = this.c.iterator();
|
||||
world.timings.tracker1.startTiming(); // Paper
|
||||
world.timings.tracker1.startTimingUnsafe(); // Paper
|
||||
while (iterator.hasNext()) {
|
||||
EntityTrackerEntry entitytrackerentry = (EntityTrackerEntry) iterator.next();
|
||||
|
||||
@@ -181,9 +181,9 @@ public class EntityTracker {
|
||||
}
|
||||
}
|
||||
}
|
||||
world.timings.tracker1.stopTiming(); // Paper
|
||||
world.timings.tracker1.stopTimingUnsafe(); // Paper
|
||||
|
||||
world.timings.tracker2.startTiming(); // Paper
|
||||
world.timings.tracker2.startTimingUnsafe(); // Paper
|
||||
for (int i = 0; i < list.size(); ++i) {
|
||||
EntityPlayer entityplayer = (EntityPlayer) list.get(i);
|
||||
Iterator iterator1 = this.c.iterator();
|
||||
@@ -196,7 +196,7 @@ public class EntityTracker {
|
||||
}
|
||||
}
|
||||
}
|
||||
world.timings.tracker2.stopTiming(); // Paper
|
||||
world.timings.tracker2.stopTimingUnsafe(); // Paper
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -54,7 +54,7 @@ class PaperLightingQueue {
|
||||
if (isOutOfTime(maxTickTime, startTime)) {
|
||||
return true;
|
||||
}
|
||||
try (Timing ignored = chunk.world.timings.lightingQueueTimer.startTiming()) {
|
||||
try (Timing ignored = chunk.world.timings.lightingQueueTimer.startTimingUnsafe()) {
|
||||
Runnable lightUpdate;
|
||||
while ((lightUpdate = this.poll()) != null) {
|
||||
lightUpdate.run();
|
||||
|
||||
@@ -1841,7 +1841,7 @@ public class PlayerConnection implements PacketListenerPlayIn, ITickable {
|
||||
// CraftBukkit end
|
||||
|
||||
private void handleCommand(String s) {
|
||||
MinecraftTimings.playerCommandTimer.startTiming(); // Paper
|
||||
MinecraftTimings.playerCommandTimer.startTimingUnsafe(); // Paper
|
||||
// CraftBukkit start - whole method
|
||||
if ( org.spigotmc.SpigotConfig.logCommands ) // Spigot
|
||||
this.LOGGER.info(this.player.getName() + " issued server command: " + s);
|
||||
@@ -1865,7 +1865,7 @@ public class PlayerConnection implements PacketListenerPlayIn, ITickable {
|
||||
java.util.logging.Logger.getLogger(PlayerConnection.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
|
||||
return;
|
||||
} finally {
|
||||
MinecraftTimings.playerCommandTimer.stopTiming(); // Paper
|
||||
MinecraftTimings.playerCommandTimer.stopTimingUnsafe(); // Paper
|
||||
}
|
||||
// this.minecraftServer.getCommandDispatcher().a(this.player.getCommandListener(), s);
|
||||
// CraftBukkit end
|
||||
|
||||
@@ -11,7 +11,7 @@ public class PlayerConnectionUtils {
|
||||
|
||||
iasynctaskhandler.ensuresMainThread(() -> {
|
||||
if (t0 instanceof PlayerConnection && ((PlayerConnection) t0).processedDisconnect) return; // CraftBukkit
|
||||
try (Timing ignored = timing.startTiming()) { // Paper
|
||||
try (Timing ignored = timing.startTimingUnsafe()) { // Paper
|
||||
packet.a(t0);
|
||||
} // Paper - timings
|
||||
});
|
||||
|
||||
@@ -1263,7 +1263,7 @@ public abstract class PlayerList {
|
||||
public void savePlayers(Integer interval) {
|
||||
MCUtil.ensureMain("Save Players", () -> { // Paper - ensure main
|
||||
long now = MinecraftServer.currentTick;
|
||||
MinecraftTimings.savePlayers.startTiming(); // Paper
|
||||
MinecraftTimings.savePlayers.startTimingUnsafe(); // Paper
|
||||
int numSaved = 0; // Paper
|
||||
for (int i = 0; i < this.players.size(); ++i) {
|
||||
EntityPlayer entityplayer = this.players.get(i);
|
||||
@@ -1272,7 +1272,7 @@ public abstract class PlayerList {
|
||||
if (interval != null && ++numSaved <= com.destroystokyo.paper.PaperConfig.maxPlayerAutoSavePerTick) { break; } // Paper
|
||||
}
|
||||
}
|
||||
MinecraftTimings.savePlayers.stopTiming(); // Paper
|
||||
MinecraftTimings.savePlayers.stopTimingUnsafe(); // Paper
|
||||
return null; }); // Paper - ensure main
|
||||
}
|
||||
// Paper end
|
||||
|
||||
@@ -271,10 +271,10 @@ public class WorldServer extends World implements IAsyncTaskHandler {
|
||||
// CraftBukkit start - Only call spawner if we have players online and the world allows for mobs or animals
|
||||
long time = this.worldData.getTime();
|
||||
if (this.getGameRules().getBoolean("doMobSpawning") && this.worldData.getType() != WorldType.DEBUG_ALL_BLOCK_STATES && (this.allowMonsters || this.allowAnimals) && (this instanceof WorldServer && this.players.size() > 0)) {
|
||||
timings.mobSpawn.startTiming(); // Spigot
|
||||
timings.mobSpawn.startTimingUnsafe(); // Spigot
|
||||
this.spawnerCreature.a(this, this.allowMonsters && (this.ticksPerMonsterSpawns != 0 && time % this.ticksPerMonsterSpawns == 0L), this.allowAnimals && (this.ticksPerAnimalSpawns != 0 && time % this.ticksPerAnimalSpawns == 0L), this.worldData.getTime() % 400L == 0L);
|
||||
this.getChunkProvider().a(this, this.allowMonsters && (this.ticksPerMonsterSpawns != 0 && time % this.ticksPerMonsterSpawns == 0L), this.allowAnimals && (this.ticksPerAnimalSpawns != 0 && time % this.ticksPerAnimalSpawns == 0L));
|
||||
timings.mobSpawn.stopTiming(); // Spigot
|
||||
timings.mobSpawn.stopTimingUnsafe(); // Spigot
|
||||
// CraftBukkit end
|
||||
}
|
||||
|
||||
@@ -530,7 +530,7 @@ public class WorldServer extends World implements IAsyncTaskHandler {
|
||||
}
|
||||
|
||||
//this.methodProfiler.exitEnter("tickBlocks"); // Akarin - remove caller
|
||||
timings.chunkTicksBlocks.startTiming(); // Paper
|
||||
timings.chunkTicksBlocks.startTimingUnsafe(); // Paper
|
||||
if (i > 0) {
|
||||
ChunkSection[] achunksection = chunk.getSections();
|
||||
int i1 = achunksection.length;
|
||||
@@ -562,7 +562,7 @@ public class WorldServer extends World implements IAsyncTaskHandler {
|
||||
}
|
||||
}
|
||||
}
|
||||
timings.chunkTicksBlocks.stopTiming(); // Paper
|
||||
timings.chunkTicksBlocks.stopTimingUnsafe(); // Paper
|
||||
}
|
||||
|
||||
//this.methodProfiler.exit(); // Akarin - remove caller
|
||||
@@ -868,7 +868,7 @@ public class WorldServer extends World implements IAsyncTaskHandler {
|
||||
|
||||
if (chunkproviderserver.d()) {
|
||||
if (flag) org.bukkit.Bukkit.getPluginManager().callEvent(new org.bukkit.event.world.WorldSaveEvent(getWorld())); // CraftBukkit // Paper - Incremental Auto Saving - Only fire event on full save
|
||||
timings.worldSave.startTiming(); // Paper
|
||||
timings.worldSave.startTimingUnsafe(); // Paper
|
||||
if (flag || server.serverAutoSave) { // Paper
|
||||
if (iprogressupdate != null) {
|
||||
iprogressupdate.a(new ChatMessage("menu.savingLevel", new Object[0]));
|
||||
@@ -880,9 +880,9 @@ public class WorldServer extends World implements IAsyncTaskHandler {
|
||||
}
|
||||
} // Paper
|
||||
|
||||
timings.worldSaveChunks.startTiming(); // Paper
|
||||
timings.worldSaveChunks.startTimingUnsafe(); // Paper
|
||||
chunkproviderserver.a(flag);
|
||||
timings.worldSaveChunks.stopTiming(); // Paper
|
||||
timings.worldSaveChunks.stopTimingUnsafe(); // Paper
|
||||
// CraftBukkit - ArrayList -> Collection
|
||||
/* //Paper start - disable vanilla chunk GC
|
||||
java.util.Collection<Chunk> list = chunkproviderserver.a();
|
||||
@@ -896,7 +896,7 @@ public class WorldServer extends World implements IAsyncTaskHandler {
|
||||
}
|
||||
}*/
|
||||
// Paper end
|
||||
timings.worldSave.stopTiming(); // Paper
|
||||
timings.worldSave.stopTimingUnsafe(); // Paper
|
||||
}
|
||||
}
|
||||
|
||||
@@ -909,7 +909,7 @@ public class WorldServer extends World implements IAsyncTaskHandler {
|
||||
}
|
||||
|
||||
protected void a() throws ExceptionWorldConflict {
|
||||
timings.worldSaveLevel.startTiming(); // Paper
|
||||
timings.worldSaveLevel.startTimingUnsafe(); // Paper
|
||||
this.checkSession();
|
||||
Iterator iterator = this.server.getWorlds().iterator();
|
||||
|
||||
@@ -933,7 +933,7 @@ public class WorldServer extends World implements IAsyncTaskHandler {
|
||||
this.worldData.c(this.server.getBossBattleCustomData().c());
|
||||
this.dataManager.saveWorldData(this.worldData, this.server.getPlayerList().t());
|
||||
this.h().a();
|
||||
timings.worldSaveLevel.stopTiming(); // Paper
|
||||
timings.worldSaveLevel.stopTimingUnsafe(); // Paper
|
||||
}
|
||||
|
||||
// CraftBukkit start
|
||||
|
||||
@@ -479,10 +479,10 @@ public class CraftScheduler implements BukkitScheduler {
|
||||
runners.remove(task.getTaskId());
|
||||
}
|
||||
}
|
||||
MinecraftTimings.bukkitSchedulerFinishTimer.startTiming();
|
||||
MinecraftTimings.bukkitSchedulerFinishTimer.startTimingUnsafe();
|
||||
pending.addAll(temp);
|
||||
temp.clear();
|
||||
MinecraftTimings.bukkitSchedulerFinishTimer.stopTiming();
|
||||
MinecraftTimings.bukkitSchedulerFinishTimer.stopTimingUnsafe();
|
||||
//debugHead = debugHead.getNextHead(currentTick); // Paper
|
||||
}
|
||||
|
||||
@@ -521,7 +521,7 @@ public class CraftScheduler implements BukkitScheduler {
|
||||
}
|
||||
|
||||
void parsePending() { // Paper
|
||||
if (!this.isAsyncScheduler) MinecraftTimings.bukkitSchedulerPendingTimer.startTiming(); // Paper
|
||||
if (!this.isAsyncScheduler) MinecraftTimings.bukkitSchedulerPendingTimer.startTimingUnsafe(); // Paper
|
||||
CraftTask head = this.head;
|
||||
CraftTask task = head.getNext();
|
||||
CraftTask lastTask = head;
|
||||
@@ -540,7 +540,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(Unsafe); // Paper
|
||||
}
|
||||
|
||||
private boolean isReady(final int currentTick) {
|
||||
|
||||
@@ -77,13 +77,13 @@ public class CraftTask implements BukkitTask, Runnable { // Spigot
|
||||
|
||||
@Override
|
||||
public void run() {
|
||||
if (timings != null && isSync()) timings.startTiming(); // Paper
|
||||
if (timings != null && isSync()) timings.startTimingUnsafe(); // Paper
|
||||
if (rTask != null) {
|
||||
rTask.run();
|
||||
} else {
|
||||
cTask.accept(this);
|
||||
}
|
||||
if (timings != null && isSync()) timings.stopTiming(); // Paper
|
||||
if (timings != null && isSync()) timings.stopTimingUnsafe(); // Paper
|
||||
}
|
||||
|
||||
long getPeriod() {
|
||||
|
||||
@@ -110,7 +110,7 @@ public class ActivationRange
|
||||
*/
|
||||
public static void activateEntities(World world)
|
||||
{
|
||||
MinecraftTimings.entityActivationCheckTimer.startTiming();
|
||||
MinecraftTimings.entityActivationCheckTimer.startTimingUnsafe();
|
||||
final int miscActivationRange = world.spigotConfig.miscActivationRange;
|
||||
final int animalActivationRange = world.spigotConfig.animalActivationRange;
|
||||
final int monsterActivationRange = world.spigotConfig.monsterActivationRange;
|
||||
@@ -147,7 +147,7 @@ public class ActivationRange
|
||||
}
|
||||
}
|
||||
}
|
||||
MinecraftTimings.entityActivationCheckTimer.stopTiming();
|
||||
MinecraftTimings.entityActivationCheckTimer.stopTimingUnsafe();
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Submodule work/Paper updated: e8bbfbfddf...25e5bfe669
Reference in New Issue
Block a user