Skip to main content
Participant
August 19, 2013
Question

IOS touch performance

  • August 19, 2013
  • 1 reply
  • 787 views

Hi, I've found a few threads on this though none which really seem to have a solution

Basically it seems like with no mouse or touch listeners, and all objects (including stage) having mouseChildren as false and mouseEnabled as false (not stage as not supported) there is a significant frame rate drop when you touch the screen.

I've been testing the below in CS6 and CC, with AIR 3.4, 3.6 and the latest 3.8 beta, all on a 3GS.

I have a very basic FLA with around 30 animated movieclips that simply loop and a single text field.

I've set stage.mouseChildren=false;

And to double confirm, looped through all movieclips on screen and set their mouseEnabled and mouseChildren to both false

On my 3GS, the AIR app runs at about 45 - 47fps.

However, when I tap the screen, or drag my finger around, it drops to closer to 35fps. Considering I don't have any touch or mouse listeners, this seems odd.

Here is the complete code I'm using (straight in the timeline), the enterframe loop simply averages out the last 10 frames in terms of ms to render.

import flash.events.Event;

import flash.utils.getTimer;

stage.mouseChildren=false;

for(var a:int=0;a<stage.numChildren;a++)

{

          MovieClip(getChildAt(a)).mouseEnabled=false;

          MovieClip(getChildAt(a)).mouseChildren=false;

}

addEventListener(Event.ENTER_FRAME,enterframe)

var avg:int=0;

var st:int=getTimer();

var at:int=0;

function enterframe(e:Event):void

{

                    avg++

                    at+=getTimer()-st;

                    if(avg==10)

                    {

 

                              tf.text=String(int(at/10));

                                        at=0;

                              avg=0;

                    }

 

                    st=getTimer()

}

If anyone knows a solution, that would be great

This topic has been closed for replies.

1 reply

PercyPeaAuthor
Participant
August 19, 2013

Ah ha! Should have tried this before, but just spotted with Scout and the telemetry options, that mouse (and gesture) events are being fired on the AIR app, despite my not including any actionscript listeners.

So my next question... is there a way to improve the performance of these listeners/events?

Known Participant
August 20, 2013

For our app (approved for sale in the App store but not yet for sale), we tested only on Ipad mini and Ipad (with retina)), and there is no drop off on performance when touching the screen.  There are times in the game which involve lots of touch events, and no drop off whatsoever. 

However, we run the game at 30 fps.

Maybe it occurs because you are trying to run at such a high frame rate.  That frame rate may not be possible to accomplish with the graphics you have in the app.

Justin

PercyPeaAuthor
Participant
August 20, 2013

I guess it's in part that the 3GS is such an old device the performance hit is more noticeable

I did another test which is interesting:

Simply make a new FLA, don't put anything on stage or in library, and publish as an AIR for IOS app (any version of AIR seems to give the same result)

Open up Adobe Scout, and with my 3GS connected, I can see the CPU usage goes from around 10% with just the white/blank canvas, up to 30% usage when you tap, or swipe/drag.

Most likely on an ipad mini/retina pad, there won't be 20% jump in cpu usage just for touching, but i'm pretty certain there will be some.

Since posting here I discovered an existing bug filed for this already : https://bugbase.adobe.com/index.cfm?event=bug&id=3376296