Skip to main content
natural_criticB837
Legend
January 9, 2013
Answered

Performance: Android much worse than iOS

  • January 9, 2013
  • 2 replies
  • 995 views

Hello guys,

I am developing a game that is using mainly Starling to render the game content as well as some classic DisplayList UI overlays (I know its not optimal).

Performance wise the Android app runs at ~10 FPS Release mode on my Samsung Galaxy S1 while the iOS app runs at ~50 FPS on my iPhone 3GS in compile and ~15 FPS in interpreter mode.

The code is the same on both versions, so I was wondering why the performance on the Samsung is so bad. Did anyone experience something similar?

This topic has been closed for replies.
Correct answer natural_criticB837

Alright I figured out what the problem was, and I feel a bit stupid about it to be sure

In Android I am dynamically loading the assets from an external swf to be able to update any time from my remote server (other than on iOS where I use swc). The gfx swf has about 150 frames on the timeline with all the different assets (for access convenience in Flash CS). Now when I load the swf, I never put it on the stage, I just access the necessary classes through getDefinitionByName(). But what I was not aware of was that the loaded swf will loop all the 150 frames the whole time in the background. So every few frames, a bunch of MovieClips where destroyed and new ones created. And this had a notable impact on the performance on Android.

By just stopping the swf on the first empty frame, I was able to increase the performance to around 40 FPS vs 50 FPS on the iPhone 3GS. Taking into account the higher display resolution for the Samsung, I would think this is reasonable.

I have to say during the process of debugging, both FlashDevelop profiler and Adobe Scout for Android where of great help. And I learned myself yet another huge lesson in ActionScript

Thanks

2 replies

natural_criticB837
natural_criticB837AuthorCorrect answer
Legend
January 10, 2013

Alright I figured out what the problem was, and I feel a bit stupid about it to be sure

In Android I am dynamically loading the assets from an external swf to be able to update any time from my remote server (other than on iOS where I use swc). The gfx swf has about 150 frames on the timeline with all the different assets (for access convenience in Flash CS). Now when I load the swf, I never put it on the stage, I just access the necessary classes through getDefinitionByName(). But what I was not aware of was that the loaded swf will loop all the 150 frames the whole time in the background. So every few frames, a bunch of MovieClips where destroyed and new ones created. And this had a notable impact on the performance on Android.

By just stopping the swf on the first empty frame, I was able to increase the performance to around 40 FPS vs 50 FPS on the iPhone 3GS. Taking into account the higher display resolution for the Samsung, I would think this is reasonable.

I have to say during the process of debugging, both FlashDevelop profiler and Adobe Scout for Android where of great help. And I learned myself yet another huge lesson in ActionScript

Thanks

Colin Holgate
Inspiring
January 9, 2013

What is the frame rate like on the Samsung if you don't have any Starling content? You can get away with regular displaylist over Starling without any performance penalty, but it could be that either the regular objects, or the Starling objects, are what is going slow. ?you may as well narrow it down to which it is.