Extension-spine

Hi, I’ve done many tests between Defold and other cross-platform engines (Unity, libgdx, Godot).
And the runtime spine speed of defold is fantastic both in web and on desktop.
However if I load 600 spineboy models in defold there is a very large loading time to get them all loaded (over 6 seconds) , during which the screen will be blank.
This does not happen in every other engine I tested.
This delay occurs in debug builds and release builds and bundles for desktop , web and android.
It’s not a graphics bottleneck, I converted the png’s to jpg’s and tried every graphics tickbox in defold and it didn’t help at all.
The bottlneck is spine, I just use factories to load exactly like the BunnyMark project.
Disconnecting internet didn’t help.
Is there a bottleneck when using Defold and external libraries or just spine-defold runtime?
Is there a custom setting in the project file similar to rig_count that can be increased to remove the delay?
Finding the cause of the delay would be important when deciding to make a large project using defold, also that it doesn’t exist in every other engine tested is curious.
Thanks for your help.

Hi @rhythmpattern !

I agree that it does seem like a lot of time.
Am I correct that this is only 1 spineboy model+atlas that is loaded, and you create 600 instances of that model?

Would it be possible for you to share your test project with us so we can investigate?

2 Likes

No worries,
https://github.com/rhythmpattern/SpinePerformance.
Thanks.

3 Likes

Thanks for the repro @rhythmpattern !

I now have a fix waiting approval (github PR).

In the meantime, you could help out verifying the fix for you by testing this dependency link: https://github.com/defold/extension-spine/archive/refs/heads/vertex-data-perf-fix.zip

5 Likes

Tested, I can confirm that works how I would expect! I was worried there for a few weeks when I was playing with it. Thanks for the quick response. Can you elaborate on the details out of curiosity? Something about vertices? What exactly was happening?
Thanks.

5 Likes

Sure. The fix is about dynamic allocations. Previously it was doing a lot of tiny allocations, growing a large array. Switching to preallocating the array improves the performance a lot.

6 Likes

@rhythmpattern I pushed another fix for the allocations, making the startup go almost instant. Please feel free to test again for performance.

6 Likes

Thats really amazing! The Big O algorithm time before was really bad and now it’s fantastic. It’s a really big improvement for defold and spine fans. Thank you so much. (tested latest https://github.com/defold/extension-spine/tree/vertex-data-perf-fix)
Gui spine nodes also look good up to max node count which is 512.

5 Likes