Today I made another great improvement to CPU performance regarding spine animations. First, it may be handy for other developers. Second, maybe it is something that could be implemented directly in the runtime?
In the scenes, we have many skeletons that are playing static loop animations with just poses. Like a closed gate, for example. When I detect that the animation has duration == 0 (meaning the animation is static), I disable both spine components:
SkeletonAnimation.enabled = false;
SkeletonRenderer.enabled = false;
When any other animation starts playing, the components are immediately enabled. This gave me the remaining missing ms for smooth 60fps on a low-budget CPU device.
My solution is simple and tied to specifics of my project, but I could imagine this is a kind of optimization that maybe could be done in Spine runtime itself? I mean, if you detect the only animations playing on all tracks have duration == 0 and no mixing is present, you could just stop executing most of the other code and mesh generation, etc.? I know there will probably be more edge cases, so this is just an initial idea.