-
Notifications
You must be signed in to change notification settings - Fork 4
Open
Labels
Priority: MEDThis issue is of medium priority.This issue is of medium priority.Status: TodoThis issue has been approved and needs to be completed/implemented.This issue has been approved and needs to be completed/implemented.Type: BugThis issue contains a bug.This issue contains a bug.
Description
While testing optimizations & profiling with a lot of other mods, I found QuickPlay to come up quite a bit due to the GlyphRenderer class.

The issue here is the two .stream() calls in GlyphRenderer#onRenderPlayer,
Quickplay.INSTANCE.glyphs.stream().anyMatch(glyph -> glyph.uuid.toString().equals(player.getUniqueID().toString()))
Quickplay.INSTANCE.glyphs.stream().filter(thisGlyph -> thisGlyph.uuid.equals(player.getGameProfile().getId())).collect(Collectors.toList()).get(0)
This can be easily optimized to
boolean hasGlyph = false;
for (PlayerGlyph glyph : Quickplay.INSTANCE.glyphs) {
if (glyph.uuid.toString().equals(player.getUniqueID().toString()) {
hasGlyph = true;
break;
}
}
List<PlayerGlyph> glyphList = new ArrayList<>();
for (PlayerGlyph glyph : Quickplay.INSTANCE.glyphs) {
if (glyph.uuid.equals(player.getGameProfile().getId())) {
glyphList.add(glyph);
}
}
PlayerGlyph glyph = glyphList.get(0);or something similar, just to resolve the performance issue present here, as glyph's dont seem to have the ability to toggling them, so this will run every frame for every player(?).
This profiling was done in a minute, in Lobby 1 on Skyblock.
GamingGeek
Metadata
Metadata
Assignees
Labels
Priority: MEDThis issue is of medium priority.This issue is of medium priority.Status: TodoThis issue has been approved and needs to be completed/implemented.This issue has been approved and needs to be completed/implemented.Type: BugThis issue contains a bug.This issue contains a bug.