From 42c538b10cf24788792c009c3dc5e145d8d4f40b Mon Sep 17 00:00:00 2001 From: Sotr Date: Wed, 20 Mar 2019 02:38:57 +0800 Subject: [PATCH] Remove method profiler callers --- .../minecraft/server/CustomFunctionData.java | 4 +- .../java/net/minecraft/server/Entity.java | 16 +++---- .../minecraft/server/EntityInsentient.java | 24 +++++------ .../net/minecraft/server/EntityLiving.java | 16 +++---- .../net/minecraft/server/MinecraftServer.java | 30 ++++++------- .../minecraft/server/NavigationAbstract.java | 8 ++-- .../server/PathfinderGoalSelector.java | 8 ++-- .../minecraft/server/PlayerConnection.java | 4 +- .../java/net/minecraft/server/PlayerList.java | 16 +++---- .../net/minecraft/server/TickListServer.java | 16 +++---- src/main/java/net/minecraft/server/World.java | 42 ++++++++++--------- .../net/minecraft/server/WorldServer.java | 36 ++++++++-------- 12 files changed, 112 insertions(+), 108 deletions(-) diff --git a/src/main/java/net/minecraft/server/CustomFunctionData.java b/src/main/java/net/minecraft/server/CustomFunctionData.java index 05606644a..9bccbc3d0 100644 --- a/src/main/java/net/minecraft/server/CustomFunctionData.java +++ b/src/main/java/net/minecraft/server/CustomFunctionData.java @@ -76,7 +76,7 @@ public class CustomFunctionData implements ITickable, IResourcePackListener { Collection collection = this.g().b(CustomFunctionData.e).a(); minecraftkey = CustomFunctionData.e; - this.server.methodProfiler.a(minecraftkey::toString); + //this.server.methodProfiler.a(minecraftkey::toString); // Akarin - remove caller Iterator iterator1 = collection.iterator(); while (iterator1.hasNext()) { @@ -115,7 +115,7 @@ public class CustomFunctionData implements ITickable, IResourcePackListener { try { CustomFunctionData.a customfunctiondata_a = (CustomFunctionData.a) this.h.removeFirst(); - this.server.methodProfiler.a(customfunctiondata_a::toString); + //this.server.methodProfiler.a(customfunctiondata_a::toString); // Akarin - remove caller customfunctiondata_a.a(this.h, i); } finally { //this.server.methodProfiler.exit(); // Akarin - remove caller diff --git a/src/main/java/net/minecraft/server/Entity.java b/src/main/java/net/minecraft/server/Entity.java index 443cae10d..d59859c14 100644 --- a/src/main/java/net/minecraft/server/Entity.java +++ b/src/main/java/net/minecraft/server/Entity.java @@ -360,7 +360,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke public void postTick() { // No clean way to break out of ticking once the entity has been copied to a new world, so instead we move the portalling later in the tick cycle if (!this.world.isClientSide && this.world instanceof WorldServer) { - this.world.methodProfiler.enter("portal"); + //this.world.methodProfiler.enter("portal"); // Akarin - remove caller if (this.an) { MinecraftServer minecraftserver = this.world.getMinecraftServer(); @@ -402,7 +402,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke // CraftBukkit end public void W() { - this.world.methodProfiler.enter("entityBaseTick"); + //this.world.methodProfiler.enter("entityBaseTick"); // Akarin - remove caller if (this.isPassenger() && this.getVehicle().dead) { this.stopRiding(); } @@ -638,7 +638,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke } } - this.world.methodProfiler.enter("move"); + //this.world.methodProfiler.enter("move"); // Akarin - remove caller double d4 = this.locX; double d5 = this.locY; double d6 = this.locZ; @@ -807,7 +807,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke } //this.world.methodProfiler.exit(); // Akarin - remove caller - this.world.methodProfiler.enter("rest"); + //this.world.methodProfiler.enter("rest"); // Akarin - remove caller this.recalcPosition(); this.positionChanged = d7 != d0 || d9 != d2; this.C = d1 != d8; // CraftBukkit - decompile error @@ -2560,7 +2560,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke @Nullable public Entity a(DimensionManager dimensionmanager) { if (!this.world.isClientSide && !this.dead) { - this.world.methodProfiler.enter("changeDimension"); + //this.world.methodProfiler.enter("changeDimension"); // Akarin - remove caller MinecraftServer minecraftserver = this.bK(); // CraftBukkit start - Move logic into new function "teleportTo(Location,boolean)" // DimensionManager dimensionmanager1 = this.dimension; @@ -2626,7 +2626,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke this.world.removeEntity(this); // Paper - Fully remove entity, can't have dupes in the UUID map this.dead = false; - this.world.methodProfiler.enter("reposition"); + //this.world.methodProfiler.enter("reposition"); // Akarin - remove caller /* CraftBukkit start - Handled in calculateTarget BlockPosition blockposition; @@ -2662,7 +2662,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke worldserver1.getMinecraftServer().getPlayerList().repositionEntity(this, exit, portal); // worldserver.entityJoinedWorld(this, false); // Handled in repositionEntity // CraftBukkit end - this.world.methodProfiler.exitEnter("reloading"); + //this.world.methodProfiler.exitEnter("reloading"); // Akarin - remove caller Entity entity = this.P().a((World) worldserver1); if (entity != null) { @@ -2697,7 +2697,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke //this.world.methodProfiler.exit(); // Akarin - remove caller worldserver.p(); worldserver1.p(); - // //this.world.methodProfiler.exit(); // Akarin - remove caller // CraftBukkit: Moved up to keep balanced + // this.world.methodProfiler.exit(); // CraftBukkit: Moved up to keep balanced return entity; } else { return null; diff --git a/src/main/java/net/minecraft/server/EntityInsentient.java b/src/main/java/net/minecraft/server/EntityInsentient.java index 8d7233716..f43a5d230 100644 --- a/src/main/java/net/minecraft/server/EntityInsentient.java +++ b/src/main/java/net/minecraft/server/EntityInsentient.java @@ -199,7 +199,7 @@ public abstract class EntityInsentient extends EntityLiving { public void W() { super.W(); - this.world.methodProfiler.enter("mobBaseTick"); + //this.world.methodProfiler.enter("mobBaseTick"); // Akarin - remove caller if (this.isAlive() && this.random.nextInt(1000) < this.a_++) { this.l(); this.A(); @@ -521,7 +521,7 @@ public abstract class EntityInsentient extends EntityLiving { public void movementTick() { super.movementTick(); - this.world.methodProfiler.enter("looting"); + //this.world.methodProfiler.enter("looting"); // Akarin - remove caller if (!this.world.isClientSide && this.dj() && !this.killed && this.world.getGameRules().getBoolean("mobGriefing")) { List list = this.world.a(EntityItem.class, this.getBoundingBox().grow(1.0D, 0.0D, 1.0D)); Iterator iterator = list.iterator(); @@ -660,7 +660,7 @@ public abstract class EntityInsentient extends EntityLiving { protected final void doTick() { ++this.ticksFarFromPlayer; - this.world.methodProfiler.enter("checkDespawn"); + //this.world.methodProfiler.enter("checkDespawn"); // Akarin - remove caller this.I(); //this.world.methodProfiler.exit(); // Akarin - remove caller // Spigot Start @@ -675,19 +675,19 @@ public abstract class EntityInsentient extends EntityLiving { return; } // Spigot End - this.world.methodProfiler.enter("sensing"); + //this.world.methodProfiler.enter("sensing"); // Akarin - remove caller this.bC.a(); //this.world.methodProfiler.exit(); // Akarin - remove caller - this.world.methodProfiler.enter("targetSelector"); + //this.world.methodProfiler.enter("targetSelector"); // Akarin - remove caller this.targetSelector.doTick(); //this.world.methodProfiler.exit(); // Akarin - remove caller - this.world.methodProfiler.enter("goalSelector"); + //this.world.methodProfiler.enter("goalSelector"); // Akarin - remove caller this.goalSelector.doTick(); //this.world.methodProfiler.exit(); // Akarin - remove caller - this.world.methodProfiler.enter("navigation"); + //this.world.methodProfiler.enter("navigation"); // Akarin - remove caller this.navigation.d(); //this.world.methodProfiler.exit(); // Akarin - remove caller - this.world.methodProfiler.enter("mob tick"); + //this.world.methodProfiler.enter("mob tick"); // Akarin - remove caller this.mobTick(); //this.world.methodProfiler.exit(); // Akarin - remove caller if (this.isPassenger() && this.getVehicle() instanceof EntityInsentient) { @@ -697,12 +697,12 @@ public abstract class EntityInsentient extends EntityLiving { entityinsentient.getControllerMove().a(this.getControllerMove()); } - this.world.methodProfiler.enter("controls"); - this.world.methodProfiler.enter("move"); + //this.world.methodProfiler.enter("controls"); // Akarin - remove caller + //this.world.methodProfiler.enter("move"); // Akarin - remove caller this.moveController.a(); - this.world.methodProfiler.exitEnter("look"); + //this.world.methodProfiler.exitEnter("look"); // Akarin - remove caller this.lookController.a(); - this.world.methodProfiler.exitEnter("jump"); + //this.world.methodProfiler.exitEnter("jump"); // Akarin - remove caller this.h.b(); //this.world.methodProfiler.exit(); // Akarin - remove caller //this.world.methodProfiler.exit(); // Akarin - remove caller diff --git a/src/main/java/net/minecraft/server/EntityLiving.java b/src/main/java/net/minecraft/server/EntityLiving.java index de4de810e..686149b14 100644 --- a/src/main/java/net/minecraft/server/EntityLiving.java +++ b/src/main/java/net/minecraft/server/EntityLiving.java @@ -216,7 +216,7 @@ public abstract class EntityLiving extends Entity { public void W() { this.aF = this.aG; super.W(); - this.world.methodProfiler.enter("livingEntityBaseTick"); + //this.world.methodProfiler.enter("livingEntityBaseTick"); // Akarin - remove caller boolean flag = this instanceof EntityHuman; if (this.isAlive()) { @@ -2164,10 +2164,10 @@ public abstract class EntityLiving extends Entity { } this.ba += (f3 - this.ba) * 0.3F; - this.world.methodProfiler.enter("headTurn"); + //this.world.methodProfiler.enter("headTurn"); // Akarin - remove caller f2 = this.e(f1, f2); //this.world.methodProfiler.exit(); // Akarin - remove caller - this.world.methodProfiler.enter("rangeChecks"); + //this.world.methodProfiler.enter("rangeChecks"); // Akarin - remove caller while (this.yaw - this.lastYaw < -180.0F) { this.lastYaw -= 360.0F; @@ -2327,20 +2327,20 @@ public abstract class EntityLiving extends Entity { this.motZ = 0.0D; } - this.world.methodProfiler.enter("ai"); + //this.world.methodProfiler.enter("ai"); // Akarin - remove caller if (this.isFrozen()) { this.bg = false; this.bh = 0.0F; this.bj = 0.0F; this.bk = 0.0F; } else if (this.cP()) { - this.world.methodProfiler.enter("newAi"); + //this.world.methodProfiler.enter("newAi"); // Akarin - remove caller this.doTick(); //this.world.methodProfiler.exit(); // Akarin - remove caller } //this.world.methodProfiler.exit(); // Akarin - remove caller - this.world.methodProfiler.enter("jump"); + //this.world.methodProfiler.enter("jump"); // Akarin - remove caller if (this.bg) { if (this.W > 0.0D && (!this.onGround || this.W > 0.4D)) { this.c(TagsFluid.WATER); @@ -2355,7 +2355,7 @@ public abstract class EntityLiving extends Entity { } //this.world.methodProfiler.exit(); // Akarin - remove caller - this.world.methodProfiler.enter("travel"); + //this.world.methodProfiler.enter("travel"); // Akarin - remove caller this.bh *= 0.98F; this.bj *= 0.98F; this.bk *= 0.9F; @@ -2364,7 +2364,7 @@ public abstract class EntityLiving extends Entity { this.a(this.bh, this.bi, this.bj); //this.world.methodProfiler.exit(); // Akarin - remove caller - this.world.methodProfiler.enter("push"); + //this.world.methodProfiler.enter("push"); // Akarin - remove caller if (this.bw > 0) { --this.bw; this.a(axisalignedbb, this.getBoundingBox()); diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java index bf3e33a18..b4cc891c8 100644 --- a/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java @@ -933,7 +933,7 @@ public abstract class MinecraftServer implements IAsyncTaskHandler, IMojangStati ++this.ticks; if (this.S) { this.S = false; - this.methodProfiler.a(this.ticks); + //this.methodProfiler.a(this.ticks); // Akarin - remove caller } //this.methodProfiler.enter(* // Akarin - remove caller @@ -974,7 +974,7 @@ public abstract class MinecraftServer implements IAsyncTaskHandler, IMojangStati server.playerCommandState = false; // this.saveChunks(true); // Spigot End - this.methodProfiler.exit(); + ////this.methodProfiler.exit(); // Akarin // Akarin - remove caller //} // Paper - Incremental Auto Saving //this.methodProfiler.enter(* // Akarin - remove caller @@ -986,13 +986,13 @@ public abstract class MinecraftServer implements IAsyncTaskHandler, IMojangStati this.snooper.b(); } - this.methodProfiler.exit(); + //this.methodProfiler.exit(); // Akarin //this.methodProfiler.enter(* // Akarin - remove caller long l = this.d[this.ticks % 100] = SystemUtils.getMonotonicNanos() - i; this.ap = this.ap * 0.8F + (float) l / 1000000.0F * 0.19999999F; - this.methodProfiler.exit(); - this.methodProfiler.exit(); + //this.methodProfiler.exit(); // Akarin + //this.methodProfiler.exit(); // Akarin org.spigotmc.WatchdogThread.tick(); // Spigot PaperLightingQueue.processQueue(startTime); // Paper expiringMaps.removeIf(ExpiringMap::clean); // Paper @@ -1015,11 +1015,11 @@ public abstract class MinecraftServer implements IAsyncTaskHandler, IMojangStati PaperAsyncChunkProvider.processMainThreadQueue(this); // Paper MinecraftTimings.minecraftSchedulerTimer.stopTimingUnsafe(); // Paper // Akarin - this.methodProfiler.exitEnter("commandFunctions"); + //this.methodProfiler.exitEnter("commandFunctions"); // Akarin MinecraftTimings.commandFunctionsTimer.startTimingUnsafe(); // Spigot // Akarin this.getFunctionData().tick(); MinecraftTimings.commandFunctionsTimer.stopTimingUnsafe(); // Spigot // Akarin - this.methodProfiler.exitEnter("levels"); + //this.methodProfiler.exitEnter("levels"); // Akarin // CraftBukkit start // Run tasks that are waiting on processing @@ -1073,7 +1073,7 @@ public abstract class MinecraftServer implements IAsyncTaskHandler, IMojangStati if (this.ticks % 20 == 0) { //this.methodProfiler.enter(* // Akarin - remove caller this.playerList.a((Packet) (new PacketPlayOutUpdateTime(worldserver.getTime(), worldserver.getDayTime(), worldserver.getGameRules().getBoolean("doDaylightCycle"))), worldserver.worldProvider.getDimensionManager()); - this.methodProfiler.exit(); + //this.methodProfiler.exit(); // Akarin } // CraftBukkit end */ @@ -1113,24 +1113,24 @@ public abstract class MinecraftServer implements IAsyncTaskHandler, IMojangStati throw new ReportedException(crashreport); } - this.methodProfiler.exit(); + //this.methodProfiler.exit(); // Akarin //this.methodProfiler.enter(* // Akarin - remove caller worldserver.getTracker().updatePlayers(); - this.methodProfiler.exit(); - this.methodProfiler.exit(); + //this.methodProfiler.exit(); // Akarin + //this.methodProfiler.exit(); // Akarin worldserver.explosionDensityCache.clear(); // Paper - Optimize explosions } } - this.methodProfiler.exitEnter("connection"); + //this.methodProfiler.exitEnter("connection"); // Akarin MinecraftTimings.connectionTimer.startTimingUnsafe(); // Spigot // Akarin this.getServerConnection().c(); MinecraftTimings.connectionTimer.stopTimingUnsafe(); // Spigot // Akarin - this.methodProfiler.exitEnter("players"); + //this.methodProfiler.exitEnter("players"); // Akarin MinecraftTimings.playerListTimer.startTimingUnsafe(); // Spigot // Akarin this.playerList.tick(); MinecraftTimings.playerListTimer.stopTimingUnsafe(); // Spigot // Akarin - this.methodProfiler.exitEnter("tickables"); + //this.methodProfiler.exitEnter("tickables"); // Akarin MinecraftTimings.tickablesTimer.startTimingUnsafe(); // Spigot // Akarin for (int j = 0; j < this.k.size(); ++j) { @@ -1138,7 +1138,7 @@ public abstract class MinecraftServer implements IAsyncTaskHandler, IMojangStati } MinecraftTimings.tickablesTimer.stopTimingUnsafe(); // Spigot // Akarin - this.methodProfiler.exit(); + //this.methodProfiler.exit(); // Akarin } public boolean getAllowNether() { diff --git a/src/main/java/net/minecraft/server/NavigationAbstract.java b/src/main/java/net/minecraft/server/NavigationAbstract.java index cac0ce2a3..659ad7dca 100644 --- a/src/main/java/net/minecraft/server/NavigationAbstract.java +++ b/src/main/java/net/minecraft/server/NavigationAbstract.java @@ -85,13 +85,13 @@ public abstract class NavigationAbstract { this.q = blockposition; float f = this.j(); - this.b.methodProfiler.enter("pathfind"); + //this.b.methodProfiler.enter("pathfind"); // Akarin BlockPosition blockposition1 = new BlockPosition(this.a); int i = (int) (f + 8.0F); ChunkCache chunkcache = new ChunkCache(this.b, blockposition1.a(-i, -i, -i), blockposition1.a(i, i, i), 0); PathEntity pathentity = this.r.a(chunkcache, this.a, this.q, f); - this.b.methodProfiler.exit(); + //this.b.methodProfiler.exit(); // Akarin return pathentity; } } @@ -110,13 +110,13 @@ public abstract class NavigationAbstract { this.q = blockposition; float f = this.j(); - this.b.methodProfiler.enter("pathfind"); + //this.b.methodProfiler.enter("pathfind"); // Akarin BlockPosition blockposition1 = (new BlockPosition(this.a)).up(); int i = (int) (f + 16.0F); ChunkCache chunkcache = new ChunkCache(this.b, blockposition1.a(-i, -i, -i), blockposition1.a(i, i, i), 0); PathEntity pathentity = this.r.a(chunkcache, this.a, entity, f); - this.b.methodProfiler.exit(); + //this.b.methodProfiler.exit(); // Akarin return pathentity; } } diff --git a/src/main/java/net/minecraft/server/PathfinderGoalSelector.java b/src/main/java/net/minecraft/server/PathfinderGoalSelector.java index 3e2f9c749..a3b428885 100644 --- a/src/main/java/net/minecraft/server/PathfinderGoalSelector.java +++ b/src/main/java/net/minecraft/server/PathfinderGoalSelector.java @@ -64,7 +64,7 @@ public class PathfinderGoalSelector { } public void doTick() { - this.d.enter("goalSetup"); + //this.d.enter("goalSetup"); // Akarin - remove caller Iterator iterator; PathfinderGoalSelector.PathfinderGoalSelectorItem pathfindergoalselector_pathfindergoalselectoritem; @@ -98,9 +98,9 @@ public class PathfinderGoalSelector { } } - this.d.exit(); + //this.d.exit(); // Akarin - remove caller if (!this.c.isEmpty()) { - this.d.enter("goalTick"); + //this.d.enter("goalTick"); // Akarin - remove caller iterator = this.c.iterator(); while (iterator.hasNext()) { @@ -108,7 +108,7 @@ public class PathfinderGoalSelector { pathfindergoalselector_pathfindergoalselectoritem.a.e(); } - this.d.exit(); + //this.d.exit(); // Akarin - remove caller } } diff --git a/src/main/java/net/minecraft/server/PlayerConnection.java b/src/main/java/net/minecraft/server/PlayerConnection.java index 3e9370009..b0056edac 100644 --- a/src/main/java/net/minecraft/server/PlayerConnection.java +++ b/src/main/java/net/minecraft/server/PlayerConnection.java @@ -189,7 +189,7 @@ public class PlayerConnection implements PacketListenerPlayIn, ITickable { this.E = 0; } - this.minecraftServer.methodProfiler.enter("keepAlive"); + //this.minecraftServer.methodProfiler.enter("keepAlive"); // Akarin // Paper Start - give clients a longer time to respond to pings as per pre 1.12.2 timings // This should effectively place the keepalive handling back to "as it was" before 1.12.2 long currentTime = SystemUtils.getMonotonicMillis(); @@ -211,7 +211,7 @@ public class PlayerConnection implements PacketListenerPlayIn, ITickable { } // Paper end - this.minecraftServer.methodProfiler.exit(); + //this.minecraftServer.methodProfiler.exit(); // CraftBukkit start for (int spam; (spam = this.chatThrottle) > 0 && !chatSpamField.compareAndSet(this, spam, spam - 1); ) ; if (tabSpamLimiter.get() > 0) tabSpamLimiter.getAndDecrement(); // Paper - split to seperate variable diff --git a/src/main/java/net/minecraft/server/PlayerList.java b/src/main/java/net/minecraft/server/PlayerList.java index 9aa0aec0a..f3eee29eb 100644 --- a/src/main/java/net/minecraft/server/PlayerList.java +++ b/src/main/java/net/minecraft/server/PlayerList.java @@ -880,7 +880,7 @@ public abstract class PlayerList { float f = entity.yaw; */ - worldserver.methodProfiler.enter("moving"); + //worldserver.methodProfiler.enter("moving"); // Akarin if (worldserver1.dimension == DimensionManager.NETHER) { d0 = MathHelper.a(d0 / 8.0D, worldserver1.getWorldBorder().b() + 16.0D, worldserver1.getWorldBorder().d() - 16.0D); d1 = MathHelper.a(d1 / 8.0D, worldserver1.getWorldBorder().c() + 16.0D, worldserver1.getWorldBorder().e() - 16.0D); @@ -921,9 +921,9 @@ public abstract class PlayerList { */ } - worldserver.methodProfiler.exit(); + //worldserver.methodProfiler.exit(); // Akarin - remove caller if (dimensionmanager != DimensionManager.THE_END) { - worldserver.methodProfiler.enter("placing"); + //worldserver.methodProfiler.enter("placing"); // Akarin d0 = (double) MathHelper.clamp((int) d0, -29999872, 29999872); d1 = (double) MathHelper.clamp((int) d1, -29999872, 29999872); /* @@ -935,7 +935,7 @@ public abstract class PlayerList { } */ - worldserver.methodProfiler.exit(); + //worldserver.methodProfiler.exit(); // Akarin - remove caller } // entity.spawnIn(worldserver1); @@ -955,7 +955,7 @@ public abstract class PlayerList { float f = entity.yaw; */ - worldserver.methodProfiler.enter("moving"); + //worldserver.methodProfiler.enter("moving"); // Akarin entity.setPositionRotation(exit.getX(), exit.getY(), exit.getZ(), exit.getYaw(), exit.getPitch()); if (entity.isAlive()) { worldserver.entityJoinedWorld(entity, false); @@ -996,9 +996,9 @@ public abstract class PlayerList { } */ - worldserver.methodProfiler.exit(); + //worldserver.methodProfiler.exit(); // Akarin - remove caller if (dimensionmanager != DimensionManager.THE_END) { - worldserver.methodProfiler.enter("placing"); + //worldserver.methodProfiler.enter("placing"); // Akarin /* d0 = (double) MathHelper.clamp((int) d0, -29999872, 29999872); d1 = (double) MathHelper.clamp((int) d1, -29999872, 29999872); @@ -1018,7 +1018,7 @@ public abstract class PlayerList { worldserver1.entityJoinedWorld(entity, false); } - worldserver.methodProfiler.exit(); + //worldserver.methodProfiler.exit(); // Akarin - remove caller } entity.spawnIn(worldserver1); diff --git a/src/main/java/net/minecraft/server/TickListServer.java b/src/main/java/net/minecraft/server/TickListServer.java index 6571fc595..9bb826af5 100644 --- a/src/main/java/net/minecraft/server/TickListServer.java +++ b/src/main/java/net/minecraft/server/TickListServer.java @@ -54,8 +54,8 @@ public class TickListServer implements TickList { // CraftBukkit end } - this.f.methodProfiler.enter("cleaning"); - timingCleanup.startTiming(); // Paper + //this.f.methodProfiler.enter("cleaning"); // Akarin + timingCleanup.startTimingUnsafe(); // Paper // Akarin NextTickListEntry nextticklistentry; // CraftBukkit - decompile error for (int j = 0; j < i; ++j) { @@ -68,11 +68,11 @@ public class TickListServer implements TickList { // this.nextTickListHash.remove(nextticklistentry); // CraftBukkit - use nextTickList this.g.add(nextticklistentry); } - timingCleanup.stopTiming(); // Paper + timingCleanup.stopTimingUnsafe(); // Paper // Akarin - this.f.methodProfiler.exit(); - this.f.methodProfiler.enter("ticking"); - timingTicking.startTiming(); // Paper + //this.f.methodProfiler.exit(); // Akarin + //this.f.methodProfiler.enter("ticking"); // Akarin + timingTicking.startTimingUnsafe(); // Paper // Akarin Iterator iterator = this.g.iterator(); while (iterator.hasNext()) { @@ -95,9 +95,9 @@ public class TickListServer implements TickList { } } - this.f.methodProfiler.exit(); + //this.f.methodProfiler.exit(); // Akarin this.g.clear(); - timingTicking.stopTiming(); // Paper + timingTicking.stopTimingUnsafe(); // Paper // Akarin } } diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java index ba3631646..274cd7fb8 100644 --- a/src/main/java/net/minecraft/server/World.java +++ b/src/main/java/net/minecraft/server/World.java @@ -444,7 +444,7 @@ public abstract class World implements IEntityAccess, GeneratorAccess, IIBlockAc if (iblockdata2.b(this, blockposition) != iblockdata1.b(this, blockposition) || iblockdata2.e() != iblockdata1.e()) { //this.methodProfiler.enter(* // Akarin - remove caller chunk.runOrQueueLightUpdate(() -> this.r(blockposition)); // Paper - Queue light update - this.methodProfiler.exit(); + //this.methodProfiler.exit(); // Akarin - remove caller } /* @@ -1281,7 +1281,7 @@ public abstract class World implements IEntityAccess, GeneratorAccess, IIBlockAc } } - this.methodProfiler.exitEnter("remove"); + //this.methodProfiler.exitEnter("remove"); // Akarin - remove caller timings.entityRemoval.startTimingUnsafe(); // Paper // Akarin this.entityList.removeAll(this.g); @@ -1307,7 +1307,7 @@ public abstract class World implements IEntityAccess, GeneratorAccess, IIBlockAc this.g.clear(); this.p_(); timings.entityRemoval.stopTimingUnsafe(); // Paper // Akarin - this.methodProfiler.exitEnter("regular"); + //this.methodProfiler.exitEnter("regular");// Akarin - remove caller CrashReport crashreport1; CrashReportSystemDetails crashreportsystemdetails1; @@ -1354,7 +1354,7 @@ public abstract class World implements IEntityAccess, GeneratorAccess, IIBlockAc } } - this.methodProfiler.exit(); + //this.methodProfiler.exit(); // Akarin - remove caller //this.methodProfiler.enter(* // Akarin - remove caller if (entity.dead) { // Paper start @@ -1375,12 +1375,12 @@ public abstract class World implements IEntityAccess, GeneratorAccess, IIBlockAc this.c(entity); } - this.methodProfiler.exit(); + //this.methodProfiler.exit(); // Akarin - remove caller } guardEntityList = false; // Spigot timings.entityTick.stopTimingUnsafe(); // Spigot // Akarin - this.methodProfiler.exitEnter("blockEntities"); + //this.methodProfiler.exitEnter("blockEntities");// Akarin - remove caller timings.tileEntityTick.startTimingUnsafe(); // Spigot // Akarin if (!this.tileEntityListUnload.isEmpty()) { // Paper start - Use alternate implementation with faster contains @@ -1419,12 +1419,14 @@ public abstract class World implements IEntityAccess, GeneratorAccess, IIBlockAc if (shouldTick && this.K.a(blockposition)) { // Paper end try { - this.methodProfiler.a(() -> { - return String.valueOf(TileEntityTypes.a(tileentity.C())); - }); + // Akarin start + //this.methodProfiler.a(() -> { + // return String.valueOf(TileEntityTypes.a(tileentity.C())); + //}); + // Akarin end tileentity.tickTimer.startTiming(); // Spigot ((ITickable) tileentity).tick(); - this.methodProfiler.exit(); + //this.methodProfiler.exit(); // Akarin - remove caller } catch (Throwable throwable2) { // Paper start - Prevent tile entity and entity crashes String msg = "TileEntity threw exception at " + tileentity.world.getWorld().getName() + ":" + tileentity.position.getX() + "," + tileentity.position.getY() + "," + tileentity.position.getZ(); @@ -1493,8 +1495,8 @@ public abstract class World implements IEntityAccess, GeneratorAccess, IIBlockAc timings.tileEntityPending.stopTimingUnsafe(); // Spigot // Akarin co.aikar.timings.TimingHistory.tileEntityTicks += this.tileEntityListTick.size(); // Paper - this.methodProfiler.exit(); - this.methodProfiler.exit(); + //this.methodProfiler.exit(); // Akarin - remove caller + //this.methodProfiler.exit(); // Akarin - remove caller } protected void p_() {} @@ -1563,12 +1565,14 @@ public abstract class World implements IEntityAccess, GeneratorAccess, IIBlockAc if (entity.isPassenger()) { entity.aH(); } else { - this.methodProfiler.a(() -> { - return IRegistry.ENTITY_TYPE.getKey(entity.P()).toString(); - }); + // Akarin start + //this.methodProfiler.a(() -> { + // return IRegistry.ENTITY_TYPE.getKey(entity.P()).toString(); + //}); + // Akarin end entity.tick(); entity.postTick(); // CraftBukkit - this.methodProfiler.exit(); + //this.methodProfiler.exit(); // Akarin - remove caller } } @@ -1609,7 +1613,7 @@ public abstract class World implements IEntityAccess, GeneratorAccess, IIBlockAc } } - this.methodProfiler.exit(); + //this.methodProfiler.exit(); // Akarin - remove caller if (flag && entity.inChunk) { Iterator iterator = entity.bP().iterator(); @@ -2341,7 +2345,7 @@ public abstract class World implements IEntityAccess, GeneratorAccess, IIBlockAc i = 0; } - this.methodProfiler.exit(); + //this.methodProfiler.exit(); // Akarin - remove caller //this.methodProfiler.enter(* // Akarin - remove caller while (i < j) { @@ -2390,7 +2394,7 @@ public abstract class World implements IEntityAccess, GeneratorAccess, IIBlockAc } } - this.methodProfiler.exit(); + //this.methodProfiler.exit(); // Akarin - remove caller return true; } } diff --git a/src/main/java/net/minecraft/server/WorldServer.java b/src/main/java/net/minecraft/server/WorldServer.java index 0d2ef8555..92c01be07 100644 --- a/src/main/java/net/minecraft/server/WorldServer.java +++ b/src/main/java/net/minecraft/server/WorldServer.java @@ -279,7 +279,7 @@ public class WorldServer extends World implements IAsyncTaskHandler { } timings.doChunkUnload.startTimingUnsafe(); // Spigot // Akarin - this.methodProfiler.exitEnter("chunkSource"); + //this.methodProfiler.exitEnter("chunkSource"); // Akarin - remove caller this.chunkProvider.unloadChunks(booleansupplier); int j = this.a(1.0F); @@ -293,28 +293,28 @@ public class WorldServer extends World implements IAsyncTaskHandler { } timings.doChunkUnload.stopTimingUnsafe(); // Spigot // Akarin - this.methodProfiler.exitEnter("tickPending"); + //this.methodProfiler.exitEnter("tickPending"); // Akarin - remove caller timings.scheduledBlocks.startTimingUnsafe(); // Paper // Akarin this.q(); timings.scheduledBlocks.stopTimingUnsafe(); // Paper // Akarin - this.methodProfiler.exitEnter("tickBlocks"); + //this.methodProfiler.exitEnter("tickBlocks"); // Akarin - remove caller timings.chunkTicks.startTimingUnsafe(); // Paper // Akarin this.n_(); timings.chunkTicks.stopTimingUnsafe(); // Paper // Akarin - this.methodProfiler.exitEnter("chunkMap"); + //this.methodProfiler.exitEnter("chunkMap"); // Akarin - remove caller timings.doChunkMap.startTimingUnsafe(); // Spigot // Akarin this.manager.flush(); timings.doChunkMap.stopTimingUnsafe(); // Spigot // Akarin - this.methodProfiler.exitEnter("village"); + //this.methodProfiler.exitEnter("village"); // Akarin - remove caller timings.doVillages.startTimingUnsafe(); // Spigot // Akarin this.villages.tick(); this.siegeManager.a(); timings.doVillages.stopTimingUnsafe(); // Spigot // Akarin - this.methodProfiler.exitEnter("portalForcer"); + //this.methodProfiler.exitEnter("portalForcer"); // Akarin - remove caller timings.doPortalForcer.startTimingUnsafe(); // Spigot // Akarin this.portalTravelAgent.a(this.getTime()); timings.doPortalForcer.stopTimingUnsafe(); // Spigot // Akarin - this.methodProfiler.exit(); + //this.methodProfiler.exit(); // Akarin - remove caller timings.doSounds.startTimingUnsafe(); // Spigot // Akarin this.an(); timings.doSounds.stopTimingUnsafe(); // Spigot // Akarin @@ -453,7 +453,7 @@ public class WorldServer extends World implements IAsyncTaskHandler { this.r(new BlockPosition(j, k, l)); } - this.methodProfiler.exit(); + //this.methodProfiler.exit(); // Akarin - remove caller } protected void n_() { @@ -478,12 +478,12 @@ public class WorldServer extends World implements IAsyncTaskHandler { int j = chunk.locX * 16; int k = chunk.locZ * 16; - this.methodProfiler.exitEnter("checkNextLight"); + //this.methodProfiler.exitEnter("checkNextLight"); // Akarin - remove caller chunk.x(); - this.methodProfiler.exitEnter("tickChunk"); + //this.methodProfiler.exitEnter("tickChunk"); // Akarin - remove caller chunk.d(false); if ( !chunk.areNeighborsLoaded( 1 ) ) continue; // Spigot - this.methodProfiler.exitEnter("thunder"); + //this.methodProfiler.exitEnter("thunder"); // Akarin - remove caller int l; BlockPosition blockposition; @@ -508,7 +508,7 @@ public class WorldServer extends World implements IAsyncTaskHandler { } } - this.methodProfiler.exitEnter("iceandsnow"); + //this.methodProfiler.exitEnter("iceandsnow"); // Akarin - remove caller if (!this.paperConfig.disableIceAndSnow && this.random.nextInt(16) == 0) { // Paper - Disable ice and snow this.m = this.m * 3 + 1013904223; l = this.m >> 2; @@ -529,7 +529,7 @@ public class WorldServer extends World implements IAsyncTaskHandler { } } - this.methodProfiler.exitEnter("tickBlocks"); + //this.methodProfiler.exitEnter("tickBlocks"); // Akarin - remove caller timings.chunkTicksBlocks.startTiming(); // Paper if (i > 0) { ChunkSection[] achunksection = chunk.getSections(); @@ -557,7 +557,7 @@ public class WorldServer extends World implements IAsyncTaskHandler { fluid.b(this, new BlockPosition(i2 + j, k2 + chunksection.getYPosition(), j2 + k), this.random); } - this.methodProfiler.exit(); + //this.methodProfiler.exit(); // Akarin - remove caller } } } @@ -565,7 +565,7 @@ public class WorldServer extends World implements IAsyncTaskHandler { timings.chunkTicksBlocks.stopTiming(); // Paper } - this.methodProfiler.exit(); + //this.methodProfiler.exit(); // Akarin - remove caller } } @@ -603,7 +603,7 @@ public class WorldServer extends World implements IAsyncTaskHandler { protected void p_() { super.p_(); - this.methodProfiler.exitEnter("players"); + //this.methodProfiler.exitEnter("players"); // Akarin - remove caller for (int i = 0; i < this.players.size(); ++i) { Entity entity = (Entity) this.players.get(i); @@ -630,7 +630,7 @@ public class WorldServer extends World implements IAsyncTaskHandler { } } - this.methodProfiler.exit(); + //this.methodProfiler.exit(); // Akarin - remove caller //this.methodProfiler.enter(* // Akarin - remove caller if (entity.dead) { int j = entity.chunkX; @@ -644,7 +644,7 @@ public class WorldServer extends World implements IAsyncTaskHandler { this.c(entity); } - this.methodProfiler.exit(); + //this.methodProfiler.exit(); // Akarin - remove caller } }