MinecraftForge / ForgeFlower

Forge's modifications to FernFlower. Fixing various bugs/inconsistencies. Main Repo: https://github.com/MinecraftForge/FernFlower
Apache License 2.0
80 stars 44 forks source link

Reduce allocations in getAllExprents #107

Closed jaskarth closed 2 years ago

jaskarth commented 2 years ago

This PR improves Exprent#getAllExprents by making it not allocate more than once. Previously, every single exprent in the tree would allocate it's own arraylist, which means a lot of unused arraylists were allocated, as the lists are only used to add onto the existing list. This reduces the garbage collector stress and reduces the garbage created by decompiling Minecraft by a couple gigabytes.

LexManos commented 2 years ago

From SuperCoder on discord Before before after after Honestly this could use some more testing and better numbers, but meh its simple enough change.