High performance Spigot fork that aims to fix gameplay and mechanics inconsistencies https://papermc.io/
Find a file
CraftBukkit/Spigot 803175b864 SPIGOT-7146: Reduce use of Material switch in ItemMeta
The Java compiler expands switch statements into a synthetic method that generates an int array with the enum's ordinal. For small enums this is fine, but with an enum as large as Material, this can add over one hundred thousand additional bytes of data. This unnecessarily increases CraftBukkit's overall file size by over 2MB. Where possible, simple conditions are returned. In cases where more than 2 constants are referenced, a HashSet is used (as opposed to an EnumSet which generates a large backing array into memory).

By: Parker Hawke <hawkeboyz2@hotmail.com>
2022-09-11 10:26:21 +10:00
paper-server SPIGOT-7146: Reduce use of Material switch in ItemMeta 2022-09-11 10:26:21 +10:00