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

updateAnimations rewrite is slow #180

Closed embeddedt closed 1 year ago

embeddedt commented 1 year ago

It seems that updateAnimations takes up quite a bit of CPU time now. Here is a profiler screenshot from my modpack:

image

Since most of the time is reported as "self time" it's probably caused by the loop bodies running many times. Is it possible to iterate over listAnimatedSprites instead here? We shouldn't ever care about calling updateAnimation on non-animated sprites.

https://github.com/LoliKingdom/LoliASM/blob/2b9d89b5816c0ecd9c22413a448c79946d0101d8/src/main/java/zone/rong/loliasm/client/sprite/ondemand/mixins/TextureMapMixin.java#L82