summaryrefslogtreecommitdiffstats
path: root/src/main/java/net/minecraft/server/MethodProfiler.java
diff options
context:
space:
mode:
authorMike Primm <mike@primmhome.com>2012-08-15 23:20:11 -0500
committerTravis Watkins <amaranth@ubuntu.com>2012-08-19 09:51:09 -0500
commit7dde6cc5663e1f6b84f549c54a47bc623b49fdf1 (patch)
treec362c702c8f097054774bf438fde40e4f2620f90 /src/main/java/net/minecraft/server/MethodProfiler.java
parente079d9457e283cc7eb5fb86aabb6fc340d7c69ed (diff)
downloadcraftbukkit-7dde6cc5663e1f6b84f549c54a47bc623b49fdf1.tar
craftbukkit-7dde6cc5663e1f6b84f549c54a47bc623b49fdf1.tar.gz
craftbukkit-7dde6cc5663e1f6b84f549c54a47bc623b49fdf1.tar.lz
craftbukkit-7dde6cc5663e1f6b84f549c54a47bc623b49fdf1.tar.xz
craftbukkit-7dde6cc5663e1f6b84f549c54a47bc623b49fdf1.zip
[Bleeding] Stub out MethodProfiler class
Instead of trying to track down every place this class is used we can simply stub out the entire class so it has no extra overhead.
Diffstat (limited to 'src/main/java/net/minecraft/server/MethodProfiler.java')
-rw-r--r--src/main/java/net/minecraft/server/MethodProfiler.java131
1 files changed, 8 insertions, 123 deletions
diff --git a/src/main/java/net/minecraft/server/MethodProfiler.java b/src/main/java/net/minecraft/server/MethodProfiler.java
index 4c926366..fb5072fa 100644
--- a/src/main/java/net/minecraft/server/MethodProfiler.java
+++ b/src/main/java/net/minecraft/server/MethodProfiler.java
@@ -7,128 +7,13 @@ import java.util.Iterator;
import java.util.List;
import java.util.Map;
+// CraftBukkit start - strip down to empty
public class MethodProfiler {
-
- private final List b = new ArrayList();
- private final List c = new ArrayList();
- public boolean a = false;
- private String d = "";
- private final Map e = new HashMap();
-
- public MethodProfiler() {}
-
- public void a() {
- this.e.clear();
- this.d = "";
- this.b.clear();
- }
-
- public void a(String s) {
- if (this.a) {
- if (this.d.length() > 0) {
- this.d = this.d + ".";
- }
-
- this.d = this.d + s;
- this.b.add(this.d);
- this.c.add(Long.valueOf(System.nanoTime()));
- }
- }
-
- public void b() {
- if (this.a) {
- long i = System.nanoTime();
- long j = ((Long) this.c.remove(this.c.size() - 1)).longValue();
-
- this.b.remove(this.b.size() - 1);
- long k = i - j;
-
- if (this.e.containsKey(this.d)) {
- this.e.put(this.d, Long.valueOf(((Long) this.e.get(this.d)).longValue() + k));
- } else {
- this.e.put(this.d, Long.valueOf(k));
- }
-
- if (k > 100000000L) {
- System.out.println("Something\'s taking too long! \'" + this.d + "\' took aprox " + (double) k / 1000000.0D + " ms");
- }
-
- this.d = !this.b.isEmpty() ? (String) this.b.get(this.b.size() - 1) : "";
- }
- }
-
- public List b(String s) {
- if (!this.a) {
- return null;
- } else {
- long i = this.e.containsKey("root") ? ((Long) this.e.get("root")).longValue() : 0L;
- long j = this.e.containsKey(s) ? ((Long) this.e.get(s)).longValue() : -1L;
- ArrayList arraylist = new ArrayList();
-
- if (s.length() > 0) {
- s = s + ".";
- }
-
- long k = 0L;
- Iterator iterator = this.e.keySet().iterator();
-
- while (iterator.hasNext()) {
- String s1 = (String) iterator.next();
-
- if (s1.length() > s.length() && s1.startsWith(s) && s1.indexOf(".", s.length() + 1) < 0) {
- k += ((Long) this.e.get(s1)).longValue();
- }
- }
-
- float f = (float) k;
-
- if (k < j) {
- k = j;
- }
-
- if (i < k) {
- i = k;
- }
-
- Iterator iterator1 = this.e.keySet().iterator();
-
- String s2;
-
- while (iterator1.hasNext()) {
- s2 = (String) iterator1.next();
- if (s2.length() > s.length() && s2.startsWith(s) && s2.indexOf(".", s.length() + 1) < 0) {
- long l = ((Long) this.e.get(s2)).longValue();
- double d0 = (double) l * 100.0D / (double) k;
- double d1 = (double) l * 100.0D / (double) i;
- String s3 = s2.substring(s.length());
-
- arraylist.add(new ProfilerInfo(s3, d0, d1));
- }
- }
-
- iterator1 = this.e.keySet().iterator();
-
- while (iterator1.hasNext()) {
- s2 = (String) iterator1.next();
- this.e.put(s2, Long.valueOf(((Long) this.e.get(s2)).longValue() * 999L / 1000L));
- }
-
- if ((float) k > f) {
- arraylist.add(new ProfilerInfo("unspecified", (double) ((float) k - f) * 100.0D / (double) k, (double) ((float) k - f) * 100.0D / (double) i));
- }
-
- Collections.sort(arraylist);
- arraylist.add(0, new ProfilerInfo(s, 100.0D, (double) k * 100.0D / (double) i));
- return arraylist;
- }
- }
-
- public void c(String s) {
- this.b();
- this.a(s);
- }
-
- public String c() {
- return this.b.size() == 0 ? "[UNKNOWN]" : (String) this.b.get(this.b.size() - 1);
- }
+ public final void a() { }
+ public final void a(String s) { }
+ public final void b() { }
+ public final List b(String s) { return null; }
+ public final void c(String s) { }
+ public final String c() { return null; }
}
+// CraftBukkit end