Unity 3D vs libgdx: 2D performance



Did you read my previous post about 2D frameworks for Unity 3D? I was curious how their performance compares to my favourite framework for game development: libgdx.

Again, I tested everything on my Xperia Play (on iOS you'd get roughly similar performance using an iPhone 4). My test consists of a single background sprite (640x960 px, static) and three animated sprites (all frames were packed into a single atlas texture to reduce draw calls).
Every touch spawned 10 sprites, every second touch spawned another 100 sprites (randomly selected from these three types). Sprites go from the top of the screen to the bottom of it and are deactivated and reused later (except for the libgdx test, read below). Here are the results:

Sprite countOrthello 2Dex2DSpriteManager 1SpriteManager 2libgdx
5057 fps60 fps60 fps60 fps60 fps
10018 fps60 fps60 fps60 fps60 fps
1506 fps58 fps60 fps60 fps60 fps
2004 fps52 fps60 fps60 fps60 fps
3001 fps35 fps60 fps58 fps60 fps
5001 fps22 fps58 fps52 fps60 fps
10001 fps11 fps45 fps39 fps60 fps
1500-6 fps33 fps-59 fps
2000-4 fps26 fps-43 fps
3000--17 fps-33 fps

It's worth noting that the libgdx version was built in a rush and I didn't try very hard to optimize it (the sprites aren't even deactivated/reused, because LAZY). Still, the performance is pretty great - that's one of the reasons why I love libgdx!

4 Response to "Unity 3D vs libgdx: 2D performance"

  1. junkdog says:

    Heh, that is pretty impressive... It'd be nice to have the source for each test however.

    Were the Unity benchmarks run with the normal or Pro version? From what I understand, the normal version is a bit more restrictive (http://www.arcengames.com/forums/index.php?topic=8856.0). Not sure whether any of the 2d frameworks would benefit from the Pro version though...

    Calvin says:

    Can you share your Unity project? I want to compare/test the performance of a 2D library I'm working on.

    e-dog says:

    Oh, great. I was going to try libgdx, but I was worried about the performance on the Android device a bit.

    Libgdx all the way!

Prześlij komentarz

Powered by Blogger