• Runtimes
  • [AS3/Starling] Performance & Optimization

Hi guys,

We are using Spine for animating characters with the AS3/Starling runtime. Everything is fine on iOS but since AIR is just a wrapped VM on Android, performance sucks and we are trying to improve it.

We have noted a lot of draw calls when rendering and are trying to reduce them but we are encountering some very weird issues:

  1. An "empty" skeleton (just a plain png dropped in Spine, then export) has 5 draw calls. It's a unique texture, no animation, no mesh.. so shouldn't it be 1 DRW?
  2. Adding an animation in spine (empty timeline, just pressing add, entering the name of the animation and exporting) adds a draw call. More complex animations should add DRW when running, but not just having empty animations in the file.

With a base of 5 DRW and each skeleton having 7 animations, we are at about 12 DRW per skeleton.. x10-15 skeletons on screen, plus the fact we are using meshes etc. performance is ridiculously low on Android 🙁

I included a test project. Are we doing something wrong? How can we fix/improve this?

Thanks for your help

Related Discussions
...

That doesn't sound right. Rendering is performed in SkeletonSprite spine-runtimes/SkeletonSprite.as at 3.6. It iterates through all slots on the skeleton, fetch a slots attachment, converts it into a SkeletonMesh if there isn't one yet, and submits it to Starling's batcher. I see no way how a single slot/attachment/image skeleton could result in 5 draw calls, unless the batcher is a bit crazy (or we submitted the mesh incorrectly). I opened an issue here [as3/starling] Unexpected number of draw calls · #1077

Thanks for your quick reply badlogic! We are aiming at a very big update to our app in about 10 days and we are quite worried about the Android situation. I would really need a solution since neither me or the artist can optimize much in the current situation.

Did you test the example yourself, do you observe the same number of draw calls? (I have 9 with the example: 2 from my test app, 5 from the base spine and 2 for the animations)

Thanks again!