Waterfall/BungeeCord-Patches/0025-Reduce-the-overhead-of-lots-and-lots-of-teams-with-t.patch
Shane Freeder 9cdf9ddbfd
Remove LowMemorySet (Fixes #394)
This set, while aiming to save memory, has heavy implications on performance
with larger sets

This set
2019-07-29 01:01:23 +01:00

27 lines
949 B
Diff

From a584905bd02b9c01d14a04a69666bb41a80ae1ba Mon Sep 17 00:00:00 2001
From: Techcable <Techcable@techcable.net>
Date: Mon, 25 Apr 2016 23:46:00 -0700
Subject: [PATCH] Reduce the overhead of lots and lots of teams with the same
names
Featherboard (and other bad plugins) use persistent scoreboards (scoreboard.dat), causing every team ever to be sent to waterfall. This is bad, and takes tons of memory.
Uses String.intern() to avoid duplicating strings
diff --git a/api/src/main/java/net/md_5/bungee/api/score/Team.java b/api/src/main/java/net/md_5/bungee/api/score/Team.java
index 849ba1cf..39f81fd1 100644
--- a/api/src/main/java/net/md_5/bungee/api/score/Team.java
+++ b/api/src/main/java/net/md_5/bungee/api/score/Team.java
@@ -29,7 +29,7 @@ public class Team
public void addPlayer(String name)
{
- players.add( name );
+ players.add(name.intern());
}
public void removePlayer(String name)
--
2.22.0