Mojira Archive
MC-105461

Unnecessary large number of allocations of Enum arrays

While not technically a bug and not a huge performance issue, this could be trivially fixed.
The problem: Every call to Enum.values() creates a copy of the internal array of values since it could be modified by the caller. As a consequence, things as iterating over all values create large numbers of objects to be collected by the GC. This is especially noticeable for EnumFacing.values()

The fix: Simply store the value array in a static variable.

Awaiting Response

...

2016-07-19, 10:30 PM

2018-05-07, 10:50 PM

2018-05-07, 10:50 PM

0

4

Unconfirmed

Minecraft 1.10.2

-