-
Notifications
You must be signed in to change notification settings - Fork 44
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
b2300f0
commit f6287a8
Showing
15 changed files
with
116 additions
and
1,933 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,75 @@ | ||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 | ||
From: Dreeam <61569423+Dreeam-qwq@users.noreply.github.com> | ||
Date: Sat, 23 Sep 2023 03:12:14 -0400 | ||
Subject: [PATCH] Remove Timings | ||
|
||
Completely remove the Timings, since it wastes too much performance. Use Spark instead. | ||
|
||
diff --git a/src/main/java/io/papermc/paper/plugin/manager/PaperEventManager.java b/src/main/java/io/papermc/paper/plugin/manager/PaperEventManager.java | ||
index 7ce9ebba8ce304d1f3f21d4f15ee5f3560d7700b..a1c9726d25479b5326fe2fa2b0f5a98d6b2da4c5 100644 | ||
--- a/src/main/java/io/papermc/paper/plugin/manager/PaperEventManager.java | ||
+++ b/src/main/java/io/papermc/paper/plugin/manager/PaperEventManager.java | ||
@@ -1,6 +1,5 @@ | ||
package io.papermc.paper.plugin.manager; | ||
|
||
-import co.aikar.timings.TimedEventExecutor; | ||
import com.destroystokyo.paper.event.server.ServerExceptionEvent; | ||
import com.destroystokyo.paper.exception.ServerEventException; | ||
import com.google.common.collect.Sets; | ||
@@ -95,7 +94,6 @@ class PaperEventManager { | ||
throw new IllegalPluginAccessException("Plugin attempted to register " + event + " while not enabled"); | ||
} | ||
|
||
- executor = new TimedEventExecutor(executor, plugin, null, event); | ||
this.getEventListeners(event).register(new RegisteredListener(listener, executor, priority, plugin, ignoreCancelled)); | ||
} | ||
|
||
@@ -182,7 +180,7 @@ class PaperEventManager { | ||
} | ||
} | ||
|
||
- EventExecutor executor = new TimedEventExecutor(EventExecutor.create(method, eventClass), plugin, method, eventClass); | ||
+ EventExecutor executor = EventExecutor.create(method, eventClass); | ||
eventSet.add(new RegisteredListener(listener, executor, eh.priority(), plugin, eh.ignoreCancelled())); | ||
} | ||
return ret; | ||
diff --git a/src/main/java/io/papermc/paper/plugin/manager/PaperPluginManagerImpl.java b/src/main/java/io/papermc/paper/plugin/manager/PaperPluginManagerImpl.java | ||
index 097500a59336db1bbfffcd1aa4cff7a8586e46ec..f06076864582ed153c6154fd7f3e9101bf21c4ac 100644 | ||
--- a/src/main/java/io/papermc/paper/plugin/manager/PaperPluginManagerImpl.java | ||
+++ b/src/main/java/io/papermc/paper/plugin/manager/PaperPluginManagerImpl.java | ||
@@ -232,7 +232,7 @@ public class PaperPluginManagerImpl implements PluginManager, DependencyContext | ||
|
||
@Override | ||
public boolean useTimings() { | ||
- return co.aikar.timings.Timings.isTimingsEnabled(); | ||
+ return false; // Leaf - Remove Timings | ||
} | ||
|
||
@Override | ||
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java | ||
index a7a8273a21434fc04b01d06708b65e80487a95d3..2550e0e4e40eccb6e01cd0b8287358c105abaebf 100644 | ||
--- a/src/main/java/net/minecraft/server/MinecraftServer.java | ||
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java | ||
@@ -3,7 +3,6 @@ package net.minecraft.server; | ||
import com.google.common.base.Preconditions; | ||
import com.google.common.base.Splitter; | ||
import com.google.common.collect.ImmutableList; | ||
-import co.aikar.timings.Timings; | ||
import com.destroystokyo.paper.event.server.PaperServerListPingEvent; | ||
import com.google.common.base.Stopwatch; | ||
import com.google.common.collect.Lists; | ||
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java | ||
index ef8041877456316fc32a382e28ee81161d962353..b4986e322cb05ad6f98bbf5eee2b571c67e4d9d3 100644 | ||
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java | ||
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java | ||
@@ -1047,10 +1047,8 @@ public final class CraftServer implements Server { | ||
commands.performCommand(results, commandLine, commandLine, true); | ||
} catch (CommandException ex) { | ||
this.pluginManager.callEvent(new com.destroystokyo.paper.event.server.ServerExceptionEvent(new com.destroystokyo.paper.exception.ServerCommandException(ex, target, sender, args))); // Paper | ||
- //target.timings.stopTiming(); // Spigot // Paper | ||
throw ex; | ||
} catch (Throwable ex) { | ||
- //target.timings.stopTiming(); // Spigot // Paper | ||
String msg = "Unhandled exception executing '" + commandLine + "' in " + target; | ||
this.pluginManager.callEvent(new com.destroystokyo.paper.event.server.ServerExceptionEvent(new com.destroystokyo.paper.exception.ServerCommandException(ex, target, sender, args))); // Paper | ||
throw new CommandException(msg, ex); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.