iPhone MAUI Performance Issues

12 posts / 0 new
Last post
marks
marks's picture
Offline
Joined: 7 Dec 2011
Posts:
iPhone MAUI Performance Issues

Greetings!

We are having some serious performance issues on the iPhone.
Basically the app is just very slow. To the point of seeming unresponsive. It takes a few seconds to register events, and animations are very laggy. It also seems to take forever to start up initially. So navigating through the app is tedious and unpleasant .

We are using MAUI, and only default components.

The app runs perfectly on all the other devices we have tested it on, including java, symbian and android phones. We thought it might have something to do with it drawing on the highest resolution, but the Desire HD also uses a very high res and it works perfectly on that.

It does run fine on the xcode iPhone emulater, but it runs that on a much lower resolution.

We are at a bit of a loss with this, and really need to get it working properly on iPhone.

Any assistance or advice would be greatly appreciated, and if you need any more information please let me know.

Thanks.

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
Sam Pickard
rival's picture
Offline
Mobile Archmage
Joined: 19 Mar 2009
Posts:

Hi, thanks for this. Are you able to share your code with our iOS team? I can ask them to have a look and see if they can find a reason for poor performance. Thanks.

marks
marks's picture
Offline
Joined: 7 Dec 2011
Posts:

Hello Sam

Here is the link to our page on Github.

https://github.com/mytcg/GameCards

That is all of our code. The folder to look at is the one named GameCardsDev.
The rest of them are just different skins for that project.

A normal run of the app would begin with the LoginScreen, and upon login would continue to the NewMenuScreen. From there the other screens can be accessed. The NewMenuScreen uses the GCMenu to display the options, which we coded, but the app lags on iPhone from the beginning, so I am fairly confident that it isn't our menu. Like it said, it also runs fine on other platforms, including java phones.

If you need any more info, please ask.

Thanks.

Sam Pickard
rival's picture
Offline
Mobile Archmage
Joined: 19 Mar 2009
Posts:

OK, I'm looking into it, but it may not be a quick fix...

Thanks

Sam

marks
marks's picture
Offline
Joined: 7 Dec 2011
Posts:

Awesome, any help is appreciated.

Hopefully we have just overlooked something...

Thanks again.

Sam Pickard
rival's picture
Offline
Mobile Archmage
Joined: 19 Mar 2009
Posts:

Hi, I've spent some time with your code. It seems that the core problem is that the MoSync maDrawImageRegion() call is slow on iOS. Although you don't use it directly, many widgets you do use have it. I'm working with the iOS team on a long term solution, but it won't be ready until at least next month, and maybe longer.

What I think you need to do is to look at using NativeUI for iOS. I think that it will do just about everything you need it to. You will find that performance is a lot higher with NativeUI, as it doesn't need maDrawImageRegion(). I can help you with this process.

Sam Pickard
rival's picture
Offline
Mobile Archmage
Joined: 19 Mar 2009
Posts:

My other thought (now I've had some more time to think) is that maDrawImageRegion can be very heavily used in WidgetSkins. WidgetSkins aren't stretched, they're tiled. If you create a skin where the central area is very small (and I've seen some where it is a 1x1 pixel), then you have to call maDrawImageRegion a lot (and I've seen some skins where this has to be drawn thousands of times) and rendering the screen becomes very slow.  I would suggest that you look at your skins and see if you can make them bigger to reduce the number of maDrawImageRegion calls are made.  Or, temporarily take them out completely and see if you get the speed improvement you need.

marks
marks's picture
Offline
Joined: 7 Dec 2011
Posts:

Hi Sam

Thanks you taking the time to look through our code. I am glad that you guys are working on that issue.
The main thing for us, about the NativeUI, is that we wanted to keep one code base, and weren't sure if thats possible with both NativeUI and MAUI.
We are also trying to avoid a rewrite of the whole app, as time is currently of the essence for us.

I will have a look at the WidgetSkins and see if there is anything I can improve, but the 4G version of the app uses much bigger versions of the normal images and it had the same issue.

Thanks

Sam Pickard
rival's picture
Offline
Mobile Archmage
Joined: 19 Mar 2009
Posts:

I've just about finished DualUI for AppMancer, which is both Widgets and NativeUI. You switch it with a single command (Widget::useNative(true)) and magically you've got the same app but in NativeUI - all the events are also wrapped up in the same way so it is genuinely one code base. I'm just trying to get it all cleaned up and tested today, but I'll send you what you need if you want to play with it. It may be too much of a jump to introduce a new UI library into a project as far advanced as yours though.

marks
marks's picture
Offline
Joined: 7 Dec 2011
Posts:

Hey Sam

Sorry for the long absence.
On an older version of MoSync, the iPhone version of the app ran on a lower resolution, and we had no performance issues. I was wondering if there is some way we can set that.
Alternatively, how different is your AppMancer to MAUI? If it is similar enough we could try to rewrite the app with that.

Thanks again.

Sam Pickard
rival's picture
Offline
Mobile Archmage
Joined: 19 Mar 2009
Posts:

No, I don't think that you can force it into the lower resolution. We're working on getting better performance with maDrawImageRegion in iOS.

The AppMancer AMUI library is a direct replacement for MAUI. Potentially, you need to include AMUI.lib (and AMDownload.lib and AMXml.lib which are both used by AMUI.lib), and then do a global search and replace changing MAUI to AMUI. That could be enough to move over to AMUI.

Once AMUI builds, then depending on what widgets you're using, you may just have to add:

#ifdef MA_PROF_STRING_PLATFORM_IPHONEOS
	Widget::setUseNativeUI(true);
#endif

and your whole app will magically be transformed into a NativeUI app.

I'll give you all the help you need if you want to try it.

http://www.appmancer.com/index.php/download.html

marks
marks's picture
Offline
Joined: 7 Dec 2011
Posts:

Magically transformed sounds great! :)

Thanks Sam, I am going to give AMUI a try, I post post if I need any help.