Waterfall/BungeeCord-Patches/0015-Micro-optimizations.patch
Shane Freeder d6688e05e6
Updated Upstream (BungeeCord)
Upstream has released updates that appear to apply and compile correctly.
This update has not been tested by PaperMC and as with ANY update, please do your own testing

BungeeCord Changes:
511017ab #3396: Update Netty version
c3e8cfac #3374, #3389: Improve log handling of normal java.util Logger usage by forwarding the LogRecords directly to the BungeeLogger instead of the fallback err stream.
bf2b3c68 #3384: Update documentation of ProxyPingEvent
68e74a8c #3378: Remove KickStringWriter from the pipeline after handshake arrives
5b4a5404 #3361: Cache MessageFormats for translations
88da5c05 #3353: Update GitHub actions
2022-11-14 19:14:25 +00:00

33 lines
1.6 KiB
Diff

From 4a506692e5bb55cbf8e871f4612fb9a53dad822e Mon Sep 17 00:00:00 2001
From: Tux <write@imaginarycode.com>
Date: Tue, 19 Jan 2016 15:13:29 -0700
Subject: [PATCH] Micro-optimizations
- PluginManager.dispatchCommand() avoids regex while splitting commands. Java 7 introduced an optimized String.split() that should be used instead (affects command dispatch).
- Don't attempt to format arguments when there are none provided
- Don't create a data input stream for every plugin message we get from servers
diff --git a/proxy/src/main/java/net/md_5/bungee/connection/DownstreamBridge.java b/proxy/src/main/java/net/md_5/bungee/connection/DownstreamBridge.java
index e41bfcfd..9c724115 100644
--- a/proxy/src/main/java/net/md_5/bungee/connection/DownstreamBridge.java
+++ b/proxy/src/main/java/net/md_5/bungee/connection/DownstreamBridge.java
@@ -259,7 +259,6 @@ public class DownstreamBridge extends PacketHandler
@SuppressWarnings("checkstyle:avoidnestedblocks")
public void handle(PluginMessage pluginMessage) throws Exception
{
- DataInput in = pluginMessage.getStream();
PluginMessageEvent event = new PluginMessageEvent( server, con, pluginMessage.getTag(), pluginMessage.getData().clone() );
if ( bungee.getPluginManager().callEvent( event ).isCancelled() )
@@ -286,6 +285,7 @@ public class DownstreamBridge extends PacketHandler
if ( pluginMessage.getTag().equals( "BungeeCord" ) )
{
+ DataInput in = pluginMessage.getStream();
ByteArrayDataOutput out = ByteStreams.newDataOutput();
String subChannel = in.readUTF();
--
2.38.1