-
Bug
-
Resolution: Fixed
-
Minecraft 1.9.4, Minecraft 1.10, Minecraft 1.11.2
-
Confirmed
The bug
Having too many resource packs in your resourcepacks-folder can cause huge performance issues when scrolling through the available resource pack list.
How to reproduce
Open the resourcepacks folder of your profile and add a lot of resource packs in there (in my case 128 duplicated versions of a single resource pack). Then start Minecraft and open the resource pack GUI.
Code analysis (+ fix)
Using the YourKit Java Profiler 2016 I found out that since Minecraft 1.9, the game reloads all resource pack icons on every frame, which is not only a huge waste of resources but causes the resource pack GUI to freeze, especially on older systems. A screenshot of the YourKit call tree of a MCP 9.24 beta Minecraft instance can be found in the attachments.
I successfully managed to fix this issue in the mentioned MCP environment by reverting the ResourcePackRepository class to how it was in < 1.9 and moving all code that actually loads the icons from the disk in the bindTexturePackIcon() method back to the updateResourcePack() method. I'm not sure though if this breaks again any recently fixed bugs.