Jump to content

Slow performance on iOS, Android runs great


st0n3vn
 Share

Recommended Posts

Hello, I have encountered a problem with iOS, which I haven't been able to address so far and I was wondering, if someone maybe has an idea of what could be going on.

I have a cordova-crosswalk Sudoku puzzle game which runs great on a large variety of Android devices, including Samsung Galaxy S2 and Note 1. Apart from bringing groups to top, there is nothing else in the update as the entire game logic revolves around input signals. To my knowledge, the game is decently optimized, given how well it performs on the aforementioned 6-year old devices.

The problem comes with iOS. I have tested the iOS build on two different iPads running iOS 9 and an iPhone 6s. They all share sluggish performance. Load times are great, and so are tweened animations, thus FPS is fine. However, a fairly simple request by the user to redraw all cells on the board takes like half a second, effectively freezing the application for the duration of redrawing.

The game's renderer is set to WebGL for iOS and Canvas for Android. I've also tried Canvas for iOS, but some textures are missing and the performance is equally sluggish. I have advancedTiming disabled. I've also tried disabling anti-aliasing and lowering the game's resolution, but to no real effect. A colleague of mine suggested the root of the problem could be the WebView used for the project, but I am using WKWebView, so that shouldn't be the issue.

One thing I could think of is maybe the large amount of bitmapdatas being created and destroyed, as well as the many sprite.loadTexture calls. However, if that was the case, wouldn't that impact performance on Androdi as well, or am I missing something. Any help would be appreciated!

Thanks in advance!

 

Edit: I just tested the app in web. I opened it simultaneously in Safari and Chrome on the same Mac and I performed the same action in exact the same game conditions. Whereas on Chrome in WebGL the operation takes visibly no time to complete (about 50ms, which is almost unnoticeable by the user), on Safari, again in WebGL, it takes about 200-250ms, which is much more visible.

Link to comment
Share on other sites

Hello, no I am not using TileSprite. In fact, I am preloading very few assets into the game, almost everything is drawn within the game onto bitmapdatas and then displayed into sprites via sprite.loadTexture()

Link to comment
Share on other sites

You can use Safari's profiling tools to find what's causing the slowdown.

You may not need loadTexture at all — you can pass a BitmapData as a sprite key, and then clear and redraw however much you want.

Link to comment
Share on other sites

Yes, thanks for that, I followed your advice and quickly reworked the draw logic so that I don't call the loadTexture method at all. Although a minor improvement can be seen, sluggish performance on iOS continues (tested on iPad mini and iPhone 6s) and is still way slower compared to Android. I've been searching for rendering issues with iOS, but haven't found anything related.

One other possible issue could be the large number of texts I am creating, drawing on bitmapdatas and after that destroying. I am currently exploring bitmaptexts, although I do need the fill for different colours, and will need to check bitmapfonts for that. I don't know how much of a performance gain that will bring though.

Will do some profiling and will report if I find anyhing interesting. Any other ideas would be very appreciated!

Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...