SpriteBatch performance seems really bad on iOS


#1

I’m moving my game over from another package to Paradox, and was doing some initial tests on drawing text using a custom static SpriteFont.

My setup:
Laptop - Windows 8.1 x64, i7, 8 GB RAM, GTX 860M
iOS - iPad 3 (iOS 7, 16 GB, WiFi model).

On Windows the performance is pretty good:

But on iOS, not so much…

Windows: ~1670 FPS (no VSync)
iOS / iPad 3: ~37 FPS (VSync (can’t disable?))

The SpriteFont is created at runtime from an external “package”, which consists of 2 textures and the glyph info.
The textures are stored using the “Paradox Image” format, and are 1024x1024 per sheet.

This is how the render pipeline looks like:

It should be noted that I am running the game in debug mode both on Windows and iOS.
An IPA built in Release config just crashes on boot, one built in AppStore config yields the same performance as in debug mode. Enabling LLVM doesn’t seem to do anything at all.

Are there any specific configuration-related things I’m forgetting? Is anyone else having issues with this?
A framerate of 37 just seems very suspicious to me… it might even be a bug in Paradox?

Thanks everyone!


#2

If you have an android device, could you try it as well? (to know if it’s iOS or OpenGL ES)


#3

Alright, after some fiddling I got it to work:

It’s pretty stable at 60 FPS, but I don’t know the ‘real’ framerate since disabling VSync doesn’t work.
What I did notice was that when using Open GL ES 3.0 the foreground of the text wasn’t rendered, only the “hello world” backdrop shadow… switching it to Open GL ES 2.0 fixed it.

I’ll try out iOS with Open GL ES 2.0 now and see if that improves anything…


#4

Sorry for the late response, iOS suddenly stopped working, but got it running again… not sure what I changed.
Setting it to Open GL ES 2 doesn’t make a difference on iOS, 3.1 doesn’t seem to run at all…
I’ll try on a spare iPhone 5, and see if it also runs bad on that one.


#5

Okay, here it is on iPhone 5:

And here’s a new version of the demo (300x4 sprites), runs at around the same FPS on my iPad.

So… I think this concludes the issue is iOS. I’ll also try the ‘new’ demo on Android in a bit.


#6

Any chance you could share a simple repro project so that we can look into it?
Thanks!


#7

I’ll send you a PM with the project.


#8

Sprite batch performance has been optimized with some native code in the last release (1.5.x). Might be good to check it out.