aboutsummaryrefslogtreecommitdiffhomepage
path: root/Spigot-Server-Patches/0206-Remove-CraftScheduler-Async-Task-Debugger.patch
diff options
context:
space:
mode:
authorZach Brown <[email protected]>2017-05-04 18:08:52 -0500
committerZach Brown <[email protected]>2017-05-04 18:08:52 -0500
commit6c3faf6aa31eec31563d495f2af638e6d7d7bb5f (patch)
tree5307a38ace2e917639f5afd5f682449ae53f4f4a /Spigot-Server-Patches/0206-Remove-CraftScheduler-Async-Task-Debugger.patch
parente9abb69799077641ee7948ab080a358dca97fa6a (diff)
downloadPaper-6c3faf6aa31eec31563d495f2af638e6d7d7bb5f.tar.gz
Paper-6c3faf6aa31eec31563d495f2af638e6d7d7bb5f.zip
Update upstream B/CB/S
Diffstat (limited to 'Spigot-Server-Patches/0206-Remove-CraftScheduler-Async-Task-Debugger.patch')
-rw-r--r--Spigot-Server-Patches/0206-Remove-CraftScheduler-Async-Task-Debugger.patch62
1 files changed, 62 insertions, 0 deletions
diff --git a/Spigot-Server-Patches/0206-Remove-CraftScheduler-Async-Task-Debugger.patch b/Spigot-Server-Patches/0206-Remove-CraftScheduler-Async-Task-Debugger.patch
new file mode 100644
index 0000000000..552213109d
--- /dev/null
+++ b/Spigot-Server-Patches/0206-Remove-CraftScheduler-Async-Task-Debugger.patch
@@ -0,0 +1,62 @@
+From 54c4e8f381c1ff582e949fabafbdec7a9dc9498f Mon Sep 17 00:00:00 2001
+From: Aikar <[email protected]>
+Date: Sun, 5 Feb 2017 00:04:04 -0500
+Subject: [PATCH] Remove CraftScheduler Async Task Debugger
+
+I have not once ever seen this system help debug a crash.
+One report of a suspected memory leak with the system.
+
+This adds additional overhead to asynchronous task dispatching
+
+diff --git a/src/main/java/org/bukkit/craftbukkit/scheduler/CraftScheduler.java b/src/main/java/org/bukkit/craftbukkit/scheduler/CraftScheduler.java
+index e30cfb7b7..448c27cc7 100644
+--- a/src/main/java/org/bukkit/craftbukkit/scheduler/CraftScheduler.java
++++ b/src/main/java/org/bukkit/craftbukkit/scheduler/CraftScheduler.java
+@@ -80,8 +80,8 @@ public class CraftScheduler implements BukkitScheduler {
+ private final ConcurrentHashMap<Integer, CraftTask> runners = new ConcurrentHashMap<Integer, CraftTask>();
+ private volatile int currentTick = -1;
+ private final Executor executor = Executors.newCachedThreadPool(new com.google.common.util.concurrent.ThreadFactoryBuilder().setNameFormat("Craft Scheduler Thread - %1$d").build()); // Spigot
+- private CraftAsyncDebugger debugHead = new CraftAsyncDebugger(-1, null, null) {@Override StringBuilder debugTo(StringBuilder string) {return string;}};
+- private CraftAsyncDebugger debugTail = debugHead;
++ //private CraftAsyncDebugger debugHead = new CraftAsyncDebugger(-1, null, null) {@Override StringBuilder debugTo(StringBuilder string) {return string;}}; // Paper
++ //private CraftAsyncDebugger debugTail = debugHead; // Paper
+ private static final int RECENT_TICKS;
+
+ static {
+@@ -371,7 +371,7 @@ public class CraftScheduler implements BukkitScheduler {
+ }
+ parsePending();
+ } else {
+- debugTail = debugTail.setNext(new CraftAsyncDebugger(currentTick + RECENT_TICKS, task.getOwner(), task.getTaskClass()));
++ //debugTail = debugTail.setNext(new CraftAsyncDebugger(currentTick + RECENT_TICKS, task.getOwner(), task.getTaskClass())); // Paper
+ executor.execute(new ServerSchedulerReportingWrapper(task)); // Paper
+ // We don't need to parse pending
+ // (async tasks must live with race-conditions if they attempt to cancel between these few lines of code)
+@@ -388,7 +388,7 @@ public class CraftScheduler implements BukkitScheduler {
+ pending.addAll(temp);
+ temp.clear();
+ MinecraftTimings.bukkitSchedulerFinishTimer.stopTiming();
+- debugHead = debugHead.getNextHead(currentTick);
++ //debugHead = debugHead.getNextHead(currentTick); // Paper
+ }
+
+ private void addTask(final CraftTask task) {
+@@ -447,10 +447,15 @@ public class CraftScheduler implements BukkitScheduler {
+
+ @Override
+ public String toString() {
++ // Paper start
++ return "";
++ /*
+ int debugTick = currentTick;
+ StringBuilder string = new StringBuilder("Recent tasks from ").append(debugTick - RECENT_TICKS).append('-').append(debugTick).append('{');
+ debugHead.debugTo(string);
+ return string.append('}').toString();
++ */
++ // Paper end
+ }
+
+ @Deprecated
+--
+2.12.2
+