I was testing my Android project using MonoGame and Xamarin when I noticed that I had a big performance issue when I deploy my game on a real device.
I’ve spent many times trying to figure out from where comes the problem, but even removing the most CPU time consuming tasks, I’ve not been able to get more than 50 FPS.
So I create a new MonoGame Android project in which I just display the FPS + the update/draw times, the performance issue is the same on my device, I can’t get above 50 FPS. I pushed the code on a Github repository: https://github.com/Noxalus/MonoGameAndroidPerformance
From what I saw, the draw time on my device (HTC One M9) is really high, around 16ms, and it seems that it’s the time to perform a GraphicsDevice.Clear().
Until now, I did my tests with a VM (thanks to Genymotion), and the problem doesn’t appear in this case.
Do you know what happens? Do you encounter the same performance issue on a real Android device?
I cannot try your code because i only have visual 2013. (It says i can’t open the project.)
Nonetheless, do you have the possibility to try the deployment on another device ?
Try playing with resolutions, customize the update time, etc ?
I don’t have a great experience with android:, I used to make apps with UE.
More experimented devs would help you far more than I can. (cf @KonajuGames among them ?)
I would have to give it a test at home. I don’t have access to a HTC One M9, but I haven’t seen this kind of performance issue on other Android devices I have.
That’s what I thought initially, but the “draw time” that I displayed here is only for the GraphicsDevice.Clear() function. If the call of the clear function exceed 16ms (so doing nothing), I can’t expect running my entire game at 60FPS… :’(
I had access to some Android devices, so I’ve been able to do some tests with the simple application that I posted in my original post (I’ve also posted an APK file on the repo => here) and here is what I got:
HTC One M9 (Android 7.0)
Average FPS: 49
Average update time: 0.03ms
Average draw time: 13ms
Samsung Galaxy S7 (Android 6.0.1)
Average FPS: 59
Average update time: 0.03ms
Average draw time: 10ms
Samsung Galaxy S6 (Android 6.0.1)
Average FPS: 59
Average update time: 0.03ms
Average draw time: 8ms
Samsung Galaxy S5 (Android 6.0.1)
Average FPS: 59
Average update time: 0.01ms
Average draw time: 0.1ms
Samsung Galaxy S4 (Android 4.4.4)
Average FPS: 60
Average update time: 0.03ms
Average draw time: 0.1ms
Nexus 4 (Android 4.4.3)
Average FPS: 60
Average update time: 0.03ms
Average draw time: 0.1ms
My device has definitely a problem, but I’m also surprised about how high is the average draw time for recent devices like the Samsung Galaxy S6 or S7
no. In my experience even if the game would run with 2000 fps it will not give me consistent 60 Hz with VerticalRetrace, which is ridiculous, since I can prove that none of the 2000 frames took longer than 16.66ms. FixedTimeStep does this a little better.