LoliKingdom / LoliASM

The lolis are now preparing to bytecode manipulate your game.
GNU Lesser General Public License v2.1
104 stars 22 forks source link

Optimize iteration over ticking FramesTextureData instances #175

Closed embeddedt closed 1 year ago

embeddedt commented 1 year ago

This PR fixes performance issues I noted in testing various 1.12 instances where sprite ticking can take up a substantial portion of client tick time. Now only sprites that are actually active get ticked, and they are stored in a data structure which is much more efficient to iterate.

Synchronizing the set is needed as mods can reload texture data from background threads (e.g. HEI when building the color search tree).

embeddedt commented 1 year ago

I wanted to keep the implementation simple. The reference set did not appear to add significant overhead from my testing.