Further optimize timings

This commit is contained in:
Sotr
2019-03-20 02:19:36 +08:00
parent dbfd5f4f2d
commit d72e245f40
15 changed files with 141 additions and 117 deletions

View File

@@ -299,7 +299,7 @@ public class Chunk implements IChunkAccess {
}
private void g(boolean flag) {
this.world.methodProfiler.enter("recheckGaps");
//this.world.methodProfiler.enter("recheckGaps"); // Akarin - remove caller
if (this.areNeighborsLoaded(1)) { // Paper
for (int i = 0; i < 16; ++i) {
for (int j = 0; j < 16; ++j) {
@@ -326,7 +326,7 @@ public class Chunk implements IChunkAccess {
}
if (flag) {
this.world.methodProfiler.exit();
//this.world.methodProfiler.exit(); // Akarin - remove caller
return;
}
}
@@ -336,7 +336,7 @@ public class Chunk implements IChunkAccess {
this.l = false;
}
this.world.methodProfiler.exit();
//this.world.methodProfiler.exit(); // Akarin - remove caller
}
private void c(int i, int j, int k) {

View File

@@ -14,7 +14,7 @@ public class ChunkMap extends Long2ObjectOpenHashMap<Chunk> {
}
public Chunk put(long i, Chunk chunk) {
chunk.world.timings.syncChunkLoadPostTimer.startTiming(); // Paper
chunk.world.timings.syncChunkLoadPostTimer.startTiming(true); // Paper // Akarin
//org.spigotmc.AsyncCatcher.catchOp("Async Chunk put"); // Paper // Akarin - comment
lastChunkByPos = chunk; // Paper
// Paper start

View File

@@ -179,7 +179,7 @@ public class ChunkProviderServer implements IChunkProvider {
this.asyncTaskHandler.postToMainThread(chunk::addEntities);
return chunk;
} else if (flag1) {
try (co.aikar.timings.Timing timing = world.timings.chunkGeneration.startTiming()) { // Paper
try (co.aikar.timings.Timing timing = world.timings.chunkGeneration.startTiming(true)) { // Paper // Akarin
this.batchScheduler.b();
this.batchScheduler.a(new ChunkCoordIntPair(i, j));
CompletableFuture<ProtoChunk> completablefuture = this.batchScheduler.c();

View File

@@ -172,7 +172,7 @@ public class CommandDispatcher {
stringreader.skip();
}
commandlistenerwrapper.getServer().methodProfiler.enter(s);
//commandlistenerwrapper.getServer().methodProfiler.enter(s); // Akarin - remove caller
byte b0;
@@ -236,7 +236,7 @@ public class CommandDispatcher {
return b1;
}
} finally {
commandlistenerwrapper.getServer().methodProfiler.exit();
//commandlistenerwrapper.getServer().methodProfiler.exit(); // Akarin - remove caller
}
return b0;

View File

@@ -61,7 +61,7 @@ public class CustomFunctionData implements ITickable, IResourcePackListener {
public void tick() {
MinecraftKey minecraftkey = CustomFunctionData.d;
this.server.methodProfiler.a(minecraftkey::toString);
//this.server.methodProfiler.a(minecraftkey::toString); // Akarin - remove caller
Iterator iterator = this.k.iterator();
while (iterator.hasNext()) {
@@ -70,7 +70,7 @@ public class CustomFunctionData implements ITickable, IResourcePackListener {
this.a(customfunction, this.f());
}
this.server.methodProfiler.exit();
//this.server.methodProfiler.exit(); // Akarin - remove caller
if (this.l) {
this.l = false;
Collection<CustomFunction> collection = this.g().b(CustomFunctionData.e).a();
@@ -85,7 +85,7 @@ public class CustomFunctionData implements ITickable, IResourcePackListener {
this.a(customfunction1, this.f());
}
this.server.methodProfiler.exit();
//this.server.methodProfiler.exit(); // Akarin - remove caller
}
}
@@ -118,7 +118,7 @@ public class CustomFunctionData implements ITickable, IResourcePackListener {
this.server.methodProfiler.a(customfunctiondata_a::toString);
customfunctiondata_a.a(this.h, i);
} finally {
this.server.methodProfiler.exit();
//this.server.methodProfiler.exit(); // Akarin - remove caller
}
++j;

View File

@@ -396,7 +396,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke
}
this.E();
this.world.methodProfiler.exit();
//this.world.methodProfiler.exit(); // Akarin - remove caller
}
}
// CraftBukkit end
@@ -456,7 +456,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke
}
this.E();
this.world.methodProfiler.exit();
//this.world.methodProfiler.exit(); // Akarin - remove caller
}
*/
@@ -499,7 +499,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke
}
this.justCreated = false;
this.world.methodProfiler.exit();
//this.world.methodProfiler.exit(); // Akarin - remove caller
}
// Paper start
@@ -806,7 +806,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke
}
}
this.world.methodProfiler.exit();
//this.world.methodProfiler.exit(); // Akarin - remove caller
this.world.methodProfiler.enter("rest");
this.recalcPosition();
this.positionChanged = d7 != d0 || d9 != d2;
@@ -939,7 +939,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke
this.fireTicks = -this.getMaxFireTicks();
}
this.world.methodProfiler.exit();
//this.world.methodProfiler.exit(); // Akarin - remove caller
}
}
@@ -2602,7 +2602,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke
// Need to make sure the profiler state is reset afterwards (but we still want to time the call)
Entity entity = this.teleportTo(exit, true);
this.world.methodProfiler.exit();
//this.world.methodProfiler.exit(); // Akarin - remove caller
return entity;
} else {
return null;
@@ -2694,10 +2694,10 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke
}
this.dead = true;
this.world.methodProfiler.exit();
//this.world.methodProfiler.exit(); // Akarin - remove caller
worldserver.p();
worldserver1.p();
// this.world.methodProfiler.exit(); // CraftBukkit: Moved up to keep balanced
// //this.world.methodProfiler.exit(); // Akarin - remove caller // CraftBukkit: Moved up to keep balanced
return entity;
} else {
return null;

View File

@@ -205,7 +205,7 @@ public abstract class EntityInsentient extends EntityLiving {
this.A();
}
this.world.methodProfiler.exit();
//this.world.methodProfiler.exit(); // Akarin - remove caller
}
protected void c(DamageSource damagesource) {
@@ -540,7 +540,7 @@ public abstract class EntityInsentient extends EntityLiving {
}
}
this.world.methodProfiler.exit();
//this.world.methodProfiler.exit(); // Akarin - remove caller
}
protected void a(EntityItem entityitem) {
@@ -662,7 +662,7 @@ public abstract class EntityInsentient extends EntityLiving {
++this.ticksFarFromPlayer;
this.world.methodProfiler.enter("checkDespawn");
this.I();
this.world.methodProfiler.exit();
//this.world.methodProfiler.exit(); // Akarin - remove caller
// Spigot Start
if ( this.fromMobSpawner )
{
@@ -677,19 +677,19 @@ public abstract class EntityInsentient extends EntityLiving {
// Spigot End
this.world.methodProfiler.enter("sensing");
this.bC.a();
this.world.methodProfiler.exit();
//this.world.methodProfiler.exit(); // Akarin - remove caller
this.world.methodProfiler.enter("targetSelector");
this.targetSelector.doTick();
this.world.methodProfiler.exit();
//this.world.methodProfiler.exit(); // Akarin - remove caller
this.world.methodProfiler.enter("goalSelector");
this.goalSelector.doTick();
this.world.methodProfiler.exit();
//this.world.methodProfiler.exit(); // Akarin - remove caller
this.world.methodProfiler.enter("navigation");
this.navigation.d();
this.world.methodProfiler.exit();
//this.world.methodProfiler.exit(); // Akarin - remove caller
this.world.methodProfiler.enter("mob tick");
this.mobTick();
this.world.methodProfiler.exit();
//this.world.methodProfiler.exit(); // Akarin - remove caller
if (this.isPassenger() && this.getVehicle() instanceof EntityInsentient) {
EntityInsentient entityinsentient = (EntityInsentient) this.getVehicle();
@@ -704,8 +704,8 @@ public abstract class EntityInsentient extends EntityLiving {
this.lookController.a();
this.world.methodProfiler.exitEnter("jump");
this.h.b();
this.world.methodProfiler.exit();
this.world.methodProfiler.exit();
//this.world.methodProfiler.exit(); // Akarin - remove caller
//this.world.methodProfiler.exit(); // Akarin - remove caller
}
protected void mobTick() {}

View File

@@ -318,7 +318,7 @@ public abstract class EntityLiving extends Entity {
this.aT = this.aS;
this.lastYaw = this.yaw;
this.lastPitch = this.pitch;
this.world.methodProfiler.exit();
//this.world.methodProfiler.exit(); // Akarin - remove caller
}
// CraftBukkit start
@@ -2166,7 +2166,7 @@ public abstract class EntityLiving extends Entity {
this.ba += (f3 - this.ba) * 0.3F;
this.world.methodProfiler.enter("headTurn");
f2 = this.e(f1, f2);
this.world.methodProfiler.exit();
//this.world.methodProfiler.exit(); // Akarin - remove caller
this.world.methodProfiler.enter("rangeChecks");
while (this.yaw - this.lastYaw < -180.0F) {
@@ -2201,7 +2201,7 @@ public abstract class EntityLiving extends Entity {
this.aT += 360.0F;
}
this.world.methodProfiler.exit();
//this.world.methodProfiler.exit(); // Akarin - remove caller
this.bb += f2;
if (this.dc()) {
++this.bv;
@@ -2336,10 +2336,10 @@ public abstract class EntityLiving extends Entity {
} else if (this.cP()) {
this.world.methodProfiler.enter("newAi");
this.doTick();
this.world.methodProfiler.exit();
//this.world.methodProfiler.exit(); // Akarin - remove caller
}
this.world.methodProfiler.exit();
//this.world.methodProfiler.exit(); // Akarin - remove caller
this.world.methodProfiler.enter("jump");
if (this.bg) {
if (this.W > 0.0D && (!this.onGround || this.W > 0.4D)) {
@@ -2354,7 +2354,7 @@ public abstract class EntityLiving extends Entity {
this.bJ = 0;
}
this.world.methodProfiler.exit();
//this.world.methodProfiler.exit(); // Akarin - remove caller
this.world.methodProfiler.enter("travel");
this.bh *= 0.98F;
this.bj *= 0.98F;
@@ -2363,7 +2363,7 @@ public abstract class EntityLiving extends Entity {
AxisAlignedBB axisalignedbb = this.getBoundingBox();
this.a(this.bh, this.bi, this.bj);
this.world.methodProfiler.exit();
//this.world.methodProfiler.exit(); // Akarin - remove caller
this.world.methodProfiler.enter("push");
if (this.bw > 0) {
--this.bw;
@@ -2371,7 +2371,7 @@ public abstract class EntityLiving extends Entity {
}
this.cN();
this.world.methodProfiler.exit();
//this.world.methodProfiler.exit(); // Akarin - remove caller
}
private void n() {

View File

@@ -244,7 +244,7 @@ public abstract class EntityMinecartAbstract extends Entity implements INamableT
--this.portalCooldown;
}
this.world.methodProfiler.exit();
//this.world.methodProfiler.exit(); // Akarin - remove caller
}
*/

View File

@@ -926,7 +926,7 @@ public abstract class MinecraftServer implements IAsyncTaskHandler, IMojangStati
public void t() {}
protected void a(BooleanSupplier booleansupplier) {
co.aikar.timings.TimingsManager.FULL_SERVER_TICK.startTiming(); // Paper
co.aikar.timings.TimingsManager.FULL_SERVER_TICK.startTimingUnsafe(); // Paper // Akarin
this.slackActivityAccountant.tickStarted(); // Spigot
long i = SystemUtils.getMonotonicNanos(); long startTime = i; // Paper
@@ -936,7 +936,7 @@ public abstract class MinecraftServer implements IAsyncTaskHandler, IMojangStati
this.methodProfiler.a(this.ticks);
}
this.methodProfiler.enter("root");
//this.methodProfiler.enter(* // Akarin - remove caller
this.b(booleansupplier);
if (i - this.Y >= 5000000000L) {
this.Y = i;
@@ -952,7 +952,7 @@ public abstract class MinecraftServer implements IAsyncTaskHandler, IMojangStati
this.m.b().a(agameprofile);
}
this.methodProfiler.enter("save");
//this.methodProfiler.enter(* // Akarin - remove caller
serverAutoSave = (autosavePeriod > 0 && this.ticks % autosavePeriod == 0); // Paper
int playerSaveInterval = com.destroystokyo.paper.PaperConfig.playerAutoSaveRate;
@@ -977,7 +977,7 @@ public abstract class MinecraftServer implements IAsyncTaskHandler, IMojangStati
this.methodProfiler.exit();
//} // Paper - Incremental Auto Saving
this.methodProfiler.enter("snooper");
//this.methodProfiler.enter(* // Akarin - remove caller
if (getSnooperEnabled() && !this.snooper.d() && this.ticks > 100) { // Spigot
this.snooper.a();
}
@@ -987,7 +987,7 @@ public abstract class MinecraftServer implements IAsyncTaskHandler, IMojangStati
}
this.methodProfiler.exit();
this.methodProfiler.enter("tallying");
//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;
@@ -997,15 +997,15 @@ public abstract class MinecraftServer implements IAsyncTaskHandler, IMojangStati
PaperLightingQueue.processQueue(startTime); // Paper
expiringMaps.removeIf(ExpiringMap::clean); // Paper
this.slackActivityAccountant.tickEnded(l); // Spigot
co.aikar.timings.TimingsManager.FULL_SERVER_TICK.stopTiming(); // Paper
co.aikar.timings.TimingsManager.FULL_SERVER_TICK.stopTimingUnsafe(); // Paper // Akarin
}
public void b(BooleanSupplier booleansupplier) {
MinecraftTimings.bukkitSchedulerTimer.startTiming(); // Paper
MinecraftTimings.bukkitSchedulerTimer.startTimingUnsafe(); // Paper // Akarin
this.server.getScheduler().mainThreadHeartbeat(this.ticks); // CraftBukkit
MinecraftTimings.bukkitSchedulerTimer.stopTiming(); // Paper
MinecraftTimings.minecraftSchedulerTimer.startTiming(); // Paper
this.methodProfiler.enter("jobs");
MinecraftTimings.bukkitSchedulerTimer.stopTimingUnsafe(); // Paper // Akarin
MinecraftTimings.minecraftSchedulerTimer.startTimingUnsafe(); // Paper // Akarin
//this.methodProfiler.enter(* // Akarin - remove caller
FutureTask futuretask;
@@ -1013,27 +1013,27 @@ public abstract class MinecraftServer implements IAsyncTaskHandler, IMojangStati
SystemUtils.a(futuretask, MinecraftServer.LOGGER);
}
PaperAsyncChunkProvider.processMainThreadQueue(this); // Paper
MinecraftTimings.minecraftSchedulerTimer.stopTiming(); // Paper
MinecraftTimings.minecraftSchedulerTimer.stopTimingUnsafe(); // Paper // Akarin
this.methodProfiler.exitEnter("commandFunctions");
MinecraftTimings.commandFunctionsTimer.startTiming(); // Spigot
MinecraftTimings.commandFunctionsTimer.startTimingUnsafe(); // Spigot // Akarin
this.getFunctionData().tick();
MinecraftTimings.commandFunctionsTimer.stopTiming(); // Spigot
MinecraftTimings.commandFunctionsTimer.stopTimingUnsafe(); // Spigot // Akarin
this.methodProfiler.exitEnter("levels");
// CraftBukkit start
// Run tasks that are waiting on processing
MinecraftTimings.processQueueTimer.startTiming(); // Spigot
MinecraftTimings.processQueueTimer.startTimingUnsafe(); // Spigot // Akarin
while (!processQueue.isEmpty()) {
processQueue.remove().run();
}
MinecraftTimings.processQueueTimer.stopTiming(); // Spigot
MinecraftTimings.processQueueTimer.stopTimingUnsafe(); // Spigot // Akarin
MinecraftTimings.chunkIOTickTimer.startTiming(); // Spigot
MinecraftTimings.chunkIOTickTimer.startTimingUnsafe(); // Spigot // Akarin
org.bukkit.craftbukkit.chunkio.ChunkIOExecutor.tick();
MinecraftTimings.chunkIOTickTimer.stopTiming(); // Spigot
MinecraftTimings.chunkIOTickTimer.stopTimingUnsafe(); // Spigot // Akarin
MinecraftTimings.timeUpdateTimer.startTiming(); // Spigot
MinecraftTimings.timeUpdateTimer.startTimingUnsafe(); // Spigot // Akarin
// Send time updates to everyone, it will get the right time from the world the player is in.
// Paper start - optimize time updates
for (final WorldServer world : this.getWorlds()) {
@@ -1053,7 +1053,7 @@ public abstract class MinecraftServer implements IAsyncTaskHandler, IMojangStati
}
}
// Paper end
MinecraftTimings.timeUpdateTimer.stopTiming(); // Spigot
MinecraftTimings.timeUpdateTimer.stopTimingUnsafe(); // Spigot // Akarin
// WorldServer worldserver; // CraftBukkit - dropped down
long i;
@@ -1071,20 +1071,20 @@ public abstract class MinecraftServer implements IAsyncTaskHandler, IMojangStati
});
/* Drop global time updates
if (this.ticks % 20 == 0) {
this.methodProfiler.enter("timeSync");
//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();
}
// CraftBukkit end */
this.methodProfiler.enter("tick");
//this.methodProfiler.enter(* // Akarin - remove caller
CrashReport crashreport;
try {
worldserver.timings.doTick.startTiming(); // Spigot
worldserver.timings.doTick.startTimingUnsafe(); // Spigot // Akarin
worldserver.doTick(booleansupplier);
worldserver.timings.doTick.stopTiming(); // Spigot
worldserver.timings.doTick.stopTimingUnsafe(); // Spigot // Akarin
} catch (Throwable throwable) {
// Spigot Start
try {
@@ -1098,9 +1098,9 @@ public abstract class MinecraftServer implements IAsyncTaskHandler, IMojangStati
}
try {
worldserver.timings.tickEntities.startTiming(); // Spigot
worldserver.timings.tickEntities.startTimingUnsafe(); // Spigot // Akarin
worldserver.tickEntities();
worldserver.timings.tickEntities.stopTiming(); // Spigot
worldserver.timings.tickEntities.stopTimingUnsafe(); // Spigot // Akarin
} catch (Throwable throwable1) {
// Spigot Start
try {
@@ -1114,7 +1114,7 @@ public abstract class MinecraftServer implements IAsyncTaskHandler, IMojangStati
}
this.methodProfiler.exit();
this.methodProfiler.enter("tracker");
//this.methodProfiler.enter(* // Akarin - remove caller
worldserver.getTracker().updatePlayers();
this.methodProfiler.exit();
this.methodProfiler.exit();
@@ -1123,20 +1123,20 @@ public abstract class MinecraftServer implements IAsyncTaskHandler, IMojangStati
}
this.methodProfiler.exitEnter("connection");
MinecraftTimings.connectionTimer.startTiming(); // Spigot
MinecraftTimings.connectionTimer.startTimingUnsafe(); // Spigot // Akarin
this.getServerConnection().c();
MinecraftTimings.connectionTimer.stopTiming(); // Spigot
MinecraftTimings.connectionTimer.stopTimingUnsafe(); // Spigot // Akarin
this.methodProfiler.exitEnter("players");
MinecraftTimings.playerListTimer.startTiming(); // Spigot
MinecraftTimings.playerListTimer.startTimingUnsafe(); // Spigot // Akarin
this.playerList.tick();
MinecraftTimings.playerListTimer.stopTiming(); // Spigot
MinecraftTimings.playerListTimer.stopTimingUnsafe(); // Spigot // Akarin
this.methodProfiler.exitEnter("tickables");
MinecraftTimings.tickablesTimer.startTiming(); // Spigot
MinecraftTimings.tickablesTimer.startTimingUnsafe(); // Spigot // Akarin
for (int j = 0; j < this.k.size(); ++j) {
((ITickable) this.k.get(j)).tick();
}
MinecraftTimings.tickablesTimer.stopTiming(); // Spigot
MinecraftTimings.tickablesTimer.stopTimingUnsafe(); // Spigot // Akarin
this.methodProfiler.exit();
}

View File

@@ -85,7 +85,7 @@ public class PlayerChunkMap {
int j;
if (i - this.k > 8000L) {
try (Timing ignored = world.timings.doChunkMapUpdate.startTiming()) { // Paper
try (Timing ignored = world.timings.doChunkMapUpdate.startTimingUnsafe()) { // Paper // Akarin
this.k = i;
for (j = 0; j < this.i.size(); ++j) {
@@ -97,7 +97,7 @@ public class PlayerChunkMap {
}
if (!this.f.isEmpty()) {
try (Timing ignored = world.timings.doChunkMapToUpdate.startTiming()) { // Paper
try (Timing ignored = world.timings.doChunkMapToUpdate.startTimingUnsafe()) { // Paper // Akarin
Iterator iterator = this.f.iterator();
while (iterator.hasNext()) {
@@ -111,7 +111,7 @@ public class PlayerChunkMap {
if (this.l && i % 4L == 0L) {
this.l = false;
try (Timing ignored = world.timings.doChunkMapSortMissing.startTiming()) { // Paper
try (Timing ignored = world.timings.doChunkMapSortMissing.startTimingUnsafe()) { // Paper // Akarin
Collections.sort(this.h, (playerchunk1, playerchunk2) -> {
return ComparisonChain.start().compare(playerchunk1.g(), playerchunk2.g()).result();
});
@@ -120,7 +120,7 @@ public class PlayerChunkMap {
if (this.m && i % 4L == 2L) {
this.m = false;
try (Timing ignored = world.timings.doChunkMapSortSendToPlayers.startTiming()) { // Paper
try (Timing ignored = world.timings.doChunkMapSortSendToPlayers.startTimingUnsafe()) { // Paper // Akarin
Collections.sort(this.g, (playerchunk1, playerchunk2) -> {
return ComparisonChain.start().compare(playerchunk1.g(), playerchunk2.g()).result();
});
@@ -128,7 +128,7 @@ public class PlayerChunkMap {
}
if (!this.h.isEmpty()) {
try (Timing ignored = world.timings.doChunkMapPlayersNeedingChunks.startTiming()) { // Paper
try (Timing ignored = world.timings.doChunkMapPlayersNeedingChunks.startTimingUnsafe()) { // Paper // Akarin
// Spigot start
org.spigotmc.SlackActivityAccountant activityAccountant = this.world.getMinecraftServer().slackActivityAccountant;
activityAccountant.startActivity(0.5);
@@ -171,7 +171,7 @@ public class PlayerChunkMap {
if (!this.g.isEmpty()) {
j = world.paperConfig.maxChunkSendsPerTick; // Paper
try (Timing ignored = world.timings.doChunkMapPendingSendToPlayers.startTiming()) { // Paper
try (Timing ignored = world.timings.doChunkMapPendingSendToPlayers.startTimingUnsafe()) { // Paper // Akarin
Iterator iterator2 = this.g.iterator();
while (iterator2.hasNext()) {
@@ -189,7 +189,7 @@ public class PlayerChunkMap {
}
if (this.managedPlayers.isEmpty()) {
try (Timing ignored = world.timings.doChunkMapUnloadChunks.startTiming()) { // Paper
try (Timing ignored = world.timings.doChunkMapUnloadChunks.startTimingUnsafe()) { // Paper // Akarin
WorldProvider worldprovider = this.world.worldProvider;
if (!worldprovider.canRespawn() && !this.world.savingDisabled) { // Paper - respect saving disabled setting

View File

@@ -442,7 +442,7 @@ public abstract class World implements IEntityAccess, GeneratorAccess, IIBlockAc
IBlockData iblockdata2 = this.getType(blockposition);
if (iblockdata2.b(this, blockposition) != iblockdata1.b(this, blockposition) || iblockdata2.e() != iblockdata1.e()) {
this.methodProfiler.enter("checkLight");
//this.methodProfiler.enter(* // Akarin - remove caller
chunk.runOrQueueLightUpdate(() -> this.r(blockposition)); // Paper - Queue light update
this.methodProfiler.exit();
}
@@ -1246,8 +1246,8 @@ public abstract class World implements IEntityAccess, GeneratorAccess, IIBlockAc
}
public void tickEntities() {
this.methodProfiler.enter("entities");
this.methodProfiler.enter("global");
//this.methodProfiler.enter(* // Akarin - remove caller
//this.methodProfiler.enter(* // Akarin - remove caller
Entity entity;
int i;
@@ -1282,7 +1282,7 @@ public abstract class World implements IEntityAccess, GeneratorAccess, IIBlockAc
}
this.methodProfiler.exitEnter("remove");
timings.entityRemoval.startTiming(); // Paper
timings.entityRemoval.startTimingUnsafe(); // Paper // Akarin
this.entityList.removeAll(this.g);
int j;
@@ -1306,14 +1306,14 @@ public abstract class World implements IEntityAccess, GeneratorAccess, IIBlockAc
this.g.clear();
this.p_();
timings.entityRemoval.stopTiming(); // Paper
timings.entityRemoval.stopTimingUnsafe(); // Paper // Akarin
this.methodProfiler.exitEnter("regular");
CrashReport crashreport1;
CrashReportSystemDetails crashreportsystemdetails1;
org.spigotmc.ActivationRange.activateEntities(this); // Spigot
timings.entityTick.startTiming(); // Spigot
timings.entityTick.startTimingUnsafe(); // Spigot // Akarin
guardEntityList = true; // Spigot
// CraftBukkit start - Use field for loop variable
co.aikar.timings.TimingHistory.entityTicks += this.entityList.size(); // Paper
@@ -1335,7 +1335,7 @@ public abstract class World implements IEntityAccess, GeneratorAccess, IIBlockAc
entity.stopRiding();
}
this.methodProfiler.enter("tick");
//this.methodProfiler.enter(* // Akarin - remove caller
if (!entity.dead && !(entity instanceof EntityPlayer)) {
try {
entity.tickTimer.startTiming(); // Paper
@@ -1355,7 +1355,7 @@ public abstract class World implements IEntityAccess, GeneratorAccess, IIBlockAc
}
this.methodProfiler.exit();
this.methodProfiler.enter("remove");
//this.methodProfiler.enter(* // Akarin - remove caller
if (entity.dead) {
// Paper start
/*
@@ -1379,9 +1379,9 @@ public abstract class World implements IEntityAccess, GeneratorAccess, IIBlockAc
}
guardEntityList = false; // Spigot
timings.entityTick.stopTiming(); // Spigot
timings.entityTick.stopTimingUnsafe(); // Spigot // Akarin
this.methodProfiler.exitEnter("blockEntities");
timings.tileEntityTick.startTiming(); // Spigot
timings.tileEntityTick.startTimingUnsafe(); // Spigot // Akarin
if (!this.tileEntityListUnload.isEmpty()) {
// Paper start - Use alternate implementation with faster contains
java.util.Set<TileEntity> toRemove = com.koloboke.collect.set.hash.HashObjSets.getDefaultFactory().withNullKeyAllowed(true).withEquivalence(com.koloboke.collect.Equivalence.identity()).newImmutableSet(tileEntityListUnload); // Akarin - koloboke
@@ -1457,8 +1457,8 @@ public abstract class World implements IEntityAccess, GeneratorAccess, IIBlockAc
}
}
timings.tileEntityTick.stopTiming(); // Spigot
timings.tileEntityPending.startTiming(); // Spigot
timings.tileEntityTick.stopTimingUnsafe(); // Spigot // Akarin
timings.tileEntityPending.startTimingUnsafe(); // Spigot // Akarin
this.J = false;
this.methodProfiler.exitEnter("pendingBlockEntities");
if (!this.c.isEmpty()) {
@@ -1491,7 +1491,7 @@ public abstract class World implements IEntityAccess, GeneratorAccess, IIBlockAc
this.c.clear();
}
timings.tileEntityPending.stopTiming(); // Spigot
timings.tileEntityPending.stopTimingUnsafe(); // Spigot // Akarin
co.aikar.timings.TimingHistory.tileEntityTicks += this.tileEntityListTick.size(); // Paper
this.methodProfiler.exit();
this.methodProfiler.exit();
@@ -1572,7 +1572,7 @@ public abstract class World implements IEntityAccess, GeneratorAccess, IIBlockAc
}
}
this.methodProfiler.enter("chunkCheck");
//this.methodProfiler.enter(* // Akarin - remove caller
if (Double.isNaN(entity.locX) || Double.isInfinite(entity.locX)) {
entity.locX = entity.N;
}
@@ -2259,7 +2259,7 @@ public abstract class World implements IEntityAccess, GeneratorAccess, IIBlockAc
int i = 0;
int j = 0;
this.methodProfiler.enter("getBrightness");
//this.methodProfiler.enter(* // Akarin - remove caller
int k = this.getBrightness(enumskyblock, blockposition);
int l = this.a(blockposition, enumskyblock);
int i1 = blockposition.getX();
@@ -2342,7 +2342,7 @@ public abstract class World implements IEntityAccess, GeneratorAccess, IIBlockAc
}
this.methodProfiler.exit();
this.methodProfiler.enter("checkedPosition < toCheckCount");
//this.methodProfiler.enter(* // Akarin - remove caller
while (i < j) {
l1 = this.E[i++];

View File

@@ -267,7 +267,7 @@ public class WorldServer extends World implements IAsyncTaskHandler {
this.i();
}
this.methodProfiler.enter("spawner");
//this.methodProfiler.enter(* // Akarin - remove caller
// 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)) {
@@ -278,7 +278,7 @@ public class WorldServer extends World implements IAsyncTaskHandler {
// CraftBukkit end
}
timings.doChunkUnload.startTiming(); // Spigot
timings.doChunkUnload.startTimingUnsafe(); // Spigot // Akarin
this.methodProfiler.exitEnter("chunkSource");
this.chunkProvider.unloadChunks(booleansupplier);
int j = this.a(1.0F);
@@ -292,37 +292,37 @@ public class WorldServer extends World implements IAsyncTaskHandler {
this.worldData.setDayTime(this.worldData.getDayTime() + 1L);
}
timings.doChunkUnload.stopTiming(); // Spigot
timings.doChunkUnload.stopTimingUnsafe(); // Spigot // Akarin
this.methodProfiler.exitEnter("tickPending");
timings.scheduledBlocks.startTiming(); // Paper
timings.scheduledBlocks.startTimingUnsafe(); // Paper // Akarin
this.q();
timings.scheduledBlocks.stopTiming(); // Paper
timings.scheduledBlocks.stopTimingUnsafe(); // Paper // Akarin
this.methodProfiler.exitEnter("tickBlocks");
timings.chunkTicks.startTiming(); // Paper
timings.chunkTicks.startTimingUnsafe(); // Paper // Akarin
this.n_();
timings.chunkTicks.stopTiming(); // Paper
timings.chunkTicks.stopTimingUnsafe(); // Paper // Akarin
this.methodProfiler.exitEnter("chunkMap");
timings.doChunkMap.startTiming(); // Spigot
timings.doChunkMap.startTimingUnsafe(); // Spigot // Akarin
this.manager.flush();
timings.doChunkMap.stopTiming(); // Spigot
timings.doChunkMap.stopTimingUnsafe(); // Spigot // Akarin
this.methodProfiler.exitEnter("village");
timings.doVillages.startTiming(); // Spigot
timings.doVillages.startTimingUnsafe(); // Spigot // Akarin
this.villages.tick();
this.siegeManager.a();
timings.doVillages.stopTiming(); // Spigot
timings.doVillages.stopTimingUnsafe(); // Spigot // Akarin
this.methodProfiler.exitEnter("portalForcer");
timings.doPortalForcer.startTiming(); // Spigot
timings.doPortalForcer.startTimingUnsafe(); // Spigot // Akarin
this.portalTravelAgent.a(this.getTime());
timings.doPortalForcer.stopTiming(); // Spigot
timings.doPortalForcer.stopTimingUnsafe(); // Spigot // Akarin
this.methodProfiler.exit();
timings.doSounds.startTiming(); // Spigot
timings.doSounds.startTimingUnsafe(); // Spigot // Akarin
this.an();
timings.doSounds.stopTiming(); // Spigot
timings.doSounds.stopTimingUnsafe(); // Spigot // Akarin
this.P = false;
timings.doChunkGC.startTiming();// Spigot
timings.doChunkGC.startTimingUnsafe();// Spigot // Akarin
this.getWorld().processChunkGC(); // CraftBukkit
timings.doChunkGC.stopTiming(); // Spigot
timings.doChunkGC.stopTimingUnsafe(); // Spigot // Akarin
}
public boolean j_() {
@@ -442,7 +442,7 @@ public class WorldServer extends World implements IAsyncTaskHandler {
}
protected void l() {
this.methodProfiler.enter("playerCheckLight");
//this.methodProfiler.enter(* // Akarin - remove caller
if (spigotConfig.randomLightUpdates && !this.players.isEmpty()) { // Spigot
int i = this.random.nextInt(this.players.size());
EntityHuman entityhuman = (EntityHuman) this.players.get(i);
@@ -470,10 +470,10 @@ public class WorldServer extends World implements IAsyncTaskHandler {
boolean flag = this.isRaining();
boolean flag1 = this.Y();
this.methodProfiler.enter("pollingChunks");
//this.methodProfiler.enter(* // Akarin - remove caller
for (Iterator iterator1 = this.manager.b(); iterator1.hasNext(); this.methodProfiler.exit()) {
this.methodProfiler.enter("getChunk");
//this.methodProfiler.enter(* // Akarin - remove caller
Chunk chunk = (Chunk) iterator1.next();
int j = chunk.locX * 16;
int k = chunk.locZ * 16;
@@ -548,7 +548,7 @@ public class WorldServer extends World implements IAsyncTaskHandler {
IBlockData iblockdata = chunksection.getType(i2, k2, j2);
Fluid fluid = chunksection.b(i2, k2, j2);
this.methodProfiler.enter("randomTick");
//this.methodProfiler.enter(* // Akarin - remove caller
if (iblockdata.t()) {
iblockdata.b((World) this, new BlockPosition(i2 + j, k2 + chunksection.getYPosition(), j2 + k), this.random);
}
@@ -617,7 +617,7 @@ public class WorldServer extends World implements IAsyncTaskHandler {
entity.stopRiding();
}
this.methodProfiler.enter("tick");
//this.methodProfiler.enter(* // Akarin - remove caller
if (!entity.dead) {
try {
this.g(entity);
@@ -631,7 +631,7 @@ public class WorldServer extends World implements IAsyncTaskHandler {
}
this.methodProfiler.exit();
this.methodProfiler.enter("remove");
//this.methodProfiler.enter(* // Akarin - remove caller
if (entity.dead) {
int j = entity.chunkX;
int k = entity.chunkZ;