Remove checkIfActive timings

Unneeded and adds extra timings cost to every entity tick
This commit is contained in:
Aikar 2016-03-18 17:11:53 -04:00
parent 6c5117b21c
commit ef251a8f81

View File

@ -1,4 +1,4 @@
From 77ceef80ad43c8d082da0a1328659e0d9cbc3bcb Mon Sep 17 00:00:00 2001 From 1630cb02eea11c5c6a1d5b71c2ec173a5f4d7cc0 Mon Sep 17 00:00:00 2001
From: Aikar <aikar@aikar.co> From: Aikar <aikar@aikar.co>
Date: Thu, 3 Mar 2016 04:00:11 -0600 Date: Thu, 3 Mar 2016 04:00:11 -0600
Subject: [PATCH] Timings v2 Subject: [PATCH] Timings v2
@ -6,10 +6,10 @@ Subject: [PATCH] Timings v2
diff --git a/src/main/java/co/aikar/timings/SpigotTimings.java b/src/main/java/co/aikar/timings/SpigotTimings.java diff --git a/src/main/java/co/aikar/timings/SpigotTimings.java b/src/main/java/co/aikar/timings/SpigotTimings.java
new file mode 100644 new file mode 100644
index 0000000..b3cafaf index 0000000..3f4271c
--- /dev/null --- /dev/null
+++ b/src/main/java/co/aikar/timings/SpigotTimings.java +++ b/src/main/java/co/aikar/timings/SpigotTimings.java
@@ -0,0 +1,111 @@ @@ -0,0 +1,110 @@
+package co.aikar.timings; +package co.aikar.timings;
+ +
+import net.minecraft.server.*; +import net.minecraft.server.*;
@ -38,7 +38,6 @@ index 0000000..b3cafaf
+ public static final Timing playerCommandTimer = Timings.ofSafe("playerCommand"); + public static final Timing playerCommandTimer = Timings.ofSafe("playerCommand");
+ +
+ public static final Timing entityActivationCheckTimer = Timings.ofSafe("entityActivationCheck"); + public static final Timing entityActivationCheckTimer = Timings.ofSafe("entityActivationCheck");
+ public static final Timing checkIfActiveTimer = Timings.ofSafe("checkIfActive");
+ +
+ public static final Timing antiXrayUpdateTimer = Timings.ofSafe("anti-xray - update"); + public static final Timing antiXrayUpdateTimer = Timings.ofSafe("anti-xray - update");
+ public static final Timing antiXrayObfuscateTimer = Timings.ofSafe("anti-xray - obfuscate"); + public static final Timing antiXrayObfuscateTimer = Timings.ofSafe("anti-xray - obfuscate");
@ -1107,7 +1106,7 @@ index e52ef47..3d90b34 100644
this.value = value; this.value = value;
} }
diff --git a/src/main/java/org/spigotmc/ActivationRange.java b/src/main/java/org/spigotmc/ActivationRange.java diff --git a/src/main/java/org/spigotmc/ActivationRange.java b/src/main/java/org/spigotmc/ActivationRange.java
index 75941ec..4d6362d 100644 index 75941ec..daed1db 100644
--- a/src/main/java/org/spigotmc/ActivationRange.java --- a/src/main/java/org/spigotmc/ActivationRange.java
+++ b/src/main/java/org/spigotmc/ActivationRange.java +++ b/src/main/java/org/spigotmc/ActivationRange.java
@@ -4,7 +4,7 @@ import java.util.List; @@ -4,7 +4,7 @@ import java.util.List;
@ -1119,6 +1118,26 @@ index 75941ec..4d6362d 100644
public class ActivationRange public class ActivationRange
{ {
-- @@ -221,11 +221,9 @@ public class ActivationRange
2.7.2 */
public static boolean checkIfActive(Entity entity)
{
- SpigotTimings.checkIfActiveTimer.startTiming();
// Never safe to skip fireworks or entities not yet added to chunk
// PAIL: inChunk
if ( !entity.isAddedToChunk() || entity instanceof EntityFireworks ) { // Paper - EAR: Fix bug with teleporting entities
- SpigotTimings.checkIfActiveTimer.stopTiming();
return true;
}
@@ -257,7 +255,6 @@ public class ActivationRange
{
isActive = false;
}
- SpigotTimings.checkIfActiveTimer.stopTiming();
return isActive;
}
}
--
2.7.4