Performance Issues

We’re currently preparing our app for W8 deployment, but we’re running into a lot of performance issues on Windows Phone devices (Nokia Lumia 830 in particular). Running on Release configs, I get huge frame drops compared to iOS and Android devices. Profiler shows the GPU as a bottleneck, with around 80 draw calls and ~2k tris. Memory doesn’t seem to be an issue since the profiler shows 50~60 mb of memory use at any time, plus compressing all textures to DXT5 didn’t make a difference either. It seems like a shader issue, I’m using 2D Toolkit with it’s custom BlendVertex shaders. Problem is, on iOS and Android mid end devices the game runs much much better, but it’s completely unplayable on W8. I tried changing the shader to Sprite/Default with negligible effect (the 2d toolkit shader is pretty similar, so I doubt it’d make a difference either way). Is reducing the draw calls the only way to get a performance boost? Or are there faster shaders than the Sprite/Default one which’ll give me the same effect? Thanks for the help.

NB: We target 30 fps, and I can barely get above 10 fps on WP8. Game runs on a constant 30fps on iPhone 4S and above.

Hi,

that difference sounds shocking - it definitely should not be the case. Does the same thing happen on the master configuration without the debugger attached? Could you show us a screenshot of the profiler?

Reducing draw call count will affect CPU usage mostly, not the GPU.


The huge spikes in the CPU usage tab are Gfx.WaitForPresent. Switching to Master configs makes no difference. Thanks

EDIT: Rendering Stats:

If you press on “Mesh.DrawVBO”, it should show you which exact objects take how long to render on the right hand side. Do all objects take a similar amount of time, or some take significantly longer?

Looks like you’re being bound by blending transparent geometry. Did you try reducing the resolution to say, 480x854 with Screen.SetResolution() just to see whether it helps the bottleneck?

Interesting. We have large sprites for our background (one 2048 * 2048 pixels and 4 512*512 pixels) which are eating up 40pc of the GPU time according to the profiler. I’ll try disabling them to see what the results are. Hopefully it should clear things up, otherwise I’ll try to force a lower resolution. Thanks!

Disabling the background helped but not by much. However, forcing the game to a lower resolution made a load of difference, and the game runs pretty smoothly if I force 0.5x the resolution, however for obvious reasons that’s a bit of a no go. We have some pretty large atlases in our game, would splitting them into smaller sizes help? I found a MSDN article which states that the max resolution of a texture should be 2000x2000 for Windows Phone apps, which seems kind of strange if it’s true (App performance considerations for Windows Phone 8 | Microsoft Learn).

That MSDN article does not apply to you - it talks about XAML rendering.

From what you described so far, and from the profiler image, it seems that you are indeed transparent fill rate bound. This means that your performance is determined by the amount of transparent pixels you draw on the screen by frame. Also, having multiple layers of them will make things much worse.

On what kind of Android phones are you testing and seeing much better performance? By the looks of it, you’re filling the screen with transparent images too many times per frame, and that should affect the performance on all mobile platforms.

Well the lowest end device we test on is the samsung galaxy grand, which manages to achieve a more stable (although still terrible) frame rate than the lumia (around ~15 fps). However the game runs almost perfectly on a Galaxy S2 (the first gen one), so it should run better on an 830, in theory at least. And you’re right, we are overdrawing quite a bit, but that doesn’t seem to effect other mobile platforms too much. Maybe the 830 gpu is particularly weak?

Lumia 830 has Adreno 305 gpu, which isn’t very spectacular, and it also has 2.4 times higher resolution than both Samsung Galaxy Grand and Samsung Galaxy S2. Furthermore, Adreno GPU tend to do worse than equivalent PowerVR GPUs (the ones in iPhone) at transparent geometry, so that might explain it even further. You’d probably see different performance numbers if your images weren’t transparent.

Well that’d require a huge overhaul of our existing assets, so I’m stuck with rendering at lower resolutions I guess. I’ll just add device specific resolution overrides then. Thanks for the help.