Excessive connection latency... Does Adobe Air support connection pooling on mobile?

Hello,
I am developing a mobile app which loads thumbnail images from a remote server. During testing on the Android platform, however, I have discovered that images are very slow to load. By monitoring server logs I have determined that the poor performance is caused by the lack of connection pooling, meaning that each request builds a new connection. Running the sample code below on a mobile device produces 20 requests and 20 connection attempts. By comparison, the same web or desktop app creates 2 connections and reuses those connections for subsequent requests. The substantial overhead and latency associated with generating new connections has a substantial affect on performance, with 20 thumbnails taking approximately 4-5 seconds to load on mobile versus 0.5 - 1 second on a desktop.
I have included a sample app below to emphasis the performance issue. The image itself is very small (290 bytes) to focus the issue on connection latency. I have confirmed this behavior on numerous Android devices, running 4.1, 4.0, and 2.3. I have also attempted using Loader v. URLLoader v. URLStream and sequential v. simultaneous loading with no change in connection behavior. Attempting to set the connection to 'keep-alive' in the URLRequest also has no affect.
package
          import flash.display.Loader;
          import flash.display.Sprite;
          import flash.display.StageAlign;
          import flash.display.StageScaleMode;
          import flash.events.Event;
          import flash.net.URLRequest;
          import flash.utils.getTimer;
          public class Main extends Sprite
                    private var _count:int = 0;
                    public function Main()
                              super();
                              stage.align = StageAlign.TOP_LEFT;
                              stage.scaleMode = StageScaleMode.NO_SCALE;
                              trace("Start time " + getTimer() + " ms");
                              var loader:Loader;
                              var url:String = "http://fbcdn-profile-a.akamaihd.net/static-ak/rsrc.php/v2/yo/r/UlIqmHJn-SK.gif";  // 290 bytes
                              for (var i:int = 0; i < 20; i++) {
                                        loader = this.addChild(new Loader()) as Loader;
                                        loader.contentLoaderInfo.addEventListener(Event.COMPLETE, complete);
                                        loader.load(new URLRequest(url));
                    private function complete(event:Event):void
                              _count++
                              trace("Finished " + _count + " at " + getTimer() + " ms");
So, I have a couple questions:
1) Is there something that I can do to enable connection reuse?
2) Is this an inherent limitation with Adobe Air for mobile?
3) Can someone confirm whether this limitation exists on other mobile platforms (iOS or Blackberry)?
Any help that you can provide would be greatly appreciated. I am really hoping that this isn't a fundamental limitation of Adobe Air as it causes my app to feel very sluggish.
Thanks,
Adam

Hmm. You were absolutely correct, that's a bit disappointing!
This is Android recompiled for 3.4 rather than 3.1.
null
COMPLETED 50 with 8 loaders in 11327 milliseconds or 226.54 per load.   50           8              11327    226.54
COMPLETED 50 with 50 loaders in 8899 milliseconds or 177.98 per load.   50           50           8899       177.98
COMPLETED 50 with 50 loaders in 9280 milliseconds or 185.6 per load.     50           50           9280       185.6
COMPLETED 50 with 50 loaders in 9513 milliseconds or 190.26 per load.   50           50           9513       190.26
COMPLETED 50 with 8 loaders in 9744 milliseconds or 194.88 per load.     50           8              9744       194.88
COMPLETED 50 with 1 loaders in 16383 milliseconds or 327.66 per load.   50           1              16383    327.66
Versus Apple iPad recompiled for 3.4 rather than 3.1.
null
COMPLETED 50 with 8 loaders in 502 milliseconds or 10.04 per load. 50      8        502    10.04
COMPLETED 50 with 50 loaders in 100 milliseconds or 2 per load.     50      50      100    2
COMPLETED 50 with 50 loaders in 117 milliseconds or 2.34 per load. 50      50      117    2.34
COMPLETED 50 with 50 loaders in 93 milliseconds or 1.86 per load.  50      50      93      1.86
COMPLETED 50 with 8 loaders in 270 milliseconds or 5.4 per load.    50      8        270    5.4
COMPLETED 50 with 8 loaders in 307 milliseconds or 6.14 per load.  50      8        307    6.14
COMPLETED 50 with 8 loaders in 316 milliseconds or 6.32 per load.  50      8        316    6.32
COMPLETED 50 with 4 loaders in 555 milliseconds or 11.1 per load.  50      4        555    11.1
COMPLETED 50 with 4 loaders in 547 milliseconds or 10.94 per load. 50      4        547    10.94
COMPLETED 50 with 4 loaders in 535 milliseconds or 10.7 per load.  50      4        535    10.7
COMPLETED 50 with 2 loaders in 1038 milliseconds or 20.76 per load.        50      2        1038          20.76
COMPLETED 50 with 2 loaders in 1042 milliseconds or 20.84 per load.        50      2        1042          20.84
COMPLETED 50 with 1 loaders in 2107 milliseconds or 42.14 per load.        50      1        2107          42.14
COMPLETED 50 with 1 loaders in 2099 milliseconds or 41.98 per load.        50      1        2099          41.98
Both are on release compile, which should take out all of the variability. So, yes, it looks as if the 3.4 AIR runtime has lost the connection pooling but ONLY for Android.
PS: Code I used in my test (which was a conventional View based Mobile app) is below in case you want to include it when you submit a bug report.
<?xml version="1.0" encoding="utf-8"?>
<s:View xmlns:fx="http://ns.adobe.com/mxml/2009"
  xmlns:s="library://ns.adobe.com/flex/spark" title="TestLLatency" xmlns:mx="library://ns.adobe.com/flex/mx">
<fx:Script>
  <![CDATA[
   import mx.events.FlexEvent;
   protected function uicomponent1_creationCompleteHandler(event:FlexEvent):void
    startTest();
   public function startTest():void {
    if(queue) throw new Error("Please wait for previous test to end.");
    queue = new Array();
    _count = 0;
    var loader:Loader;
    var i:int;
    for (i = 0; i < numToQueue; i++) {
     loader = bob.addChild(new Loader()) as Loader;
     loader.x = (i%10)*50;
     loader.y = Math.floor(i/5)*50;
     loader.contentLoaderInfo.addEventListener(Event.COMPLETE, complete);
     queue.push(loader);
    startTime = getTimer();
    for(i=0;i<numLoaders;i++) {
     nextQueue();
   protected var startTime:int;
   protected var endTime:int;
   protected var numToQueue:int = 50;
   protected var numLoaders:int = 8;
   protected var queue:Array;
   private var _count:int;
   private function complete(event:Event):void
    _count++
    nextQueue();
   [Bindable] protected var results:String;
   protected function nextQueue():void {
    var url:String = "http://fbcdn-profile-a.akamaihd.net/static-ak/rsrc.php/v2/yo/r/UlIqmHJn-SK.gif";  // 290 bytes
    if(queue && queue.length) {
     var loader:Loader = queue.pop() as Loader;
     loader.load(new URLRequest(url));
    } else if(_count==numToQueue) {
     endTime = getTimer();
     var elapsed:int = endTime-startTime;
     results += "\n"+("COMPLETED "+numToQueue+" with "+numLoaders+" loaders in "+(elapsed)+" milliseconds or "+(elapsed/numToQueue)+" per load.\t"+[numToQueue,numLoaders,elapsed,elapsed/numToQueue].join("\t"));
     queue = null;
     while(bob.numChildren>5) {
      bob.removeChildAt(bob.numChildren-1);
     bob.getChildAt(0).addEventListener(MouseEvent.CLICK,repeatTest);
     bob.getChildAt(1).addEventListener(MouseEvent.CLICK,repeatTest);
     bob.getChildAt(2).addEventListener(MouseEvent.CLICK,repeatTest);
     bob.getChildAt(3).addEventListener(MouseEvent.CLICK,repeatTest);
     bob.getChildAt(4).addEventListener(MouseEvent.CLICK,repeatTest);
   protected function repeatTest(event:MouseEvent):void {
    var dob:DisplayObject = event.target as DisplayObject;
    var testBehaviour:int = dob.parent.getChildIndex(dob);
    try {
     switch(testBehaviour) {
      case 4 :
       this.numLoaders = this.numToQueue;
       break;
      case 3 :
       this.numLoaders = 8;
       break;
      case 2 :
       this.numLoaders = 4;
       break;
      case 1 :
       this.numLoaders = 2;
       break;
      case 0 :
       this.numLoaders = 1;
       break;
     startTest();
     dob.removeEventListener(MouseEvent.CLICK,repeatTest);
     for(var i:int=0;i<5;i++) bob.removeChildAt(0);
    } catch(e:Error) {
     trace(e.message); 
  ]]>
</fx:Script>
<fx:Declarations>
  <!-- Place non-visual elements (e.g., services, value objects) here -->
</fx:Declarations>
<s:HGroup width="100%" height="100%">
  <mx:UIComponent id="bob" width="100%" height="100%" creationComplete="uicomponent1_creationCompleteHandler(event)" />
  <s:TextArea text="{results}" width="100%" height="100%" />
</s:HGroup>
</s:View>

Similar Messages

  • Does adobe air support drop shadows and blur?

    Does adobe air support drop shadows and blur? I can see it on the swf on pc but I don't see it once I put it on the android as .apk. Thanks!

    change your render mode to cpu and test.

  • Does Adobe Air support mixing 14 audio tracks with different timings with no latency?

    We are looking to port our iPhone application to Adobe Air and wanted to see if this is even feasible
    See an app demo here: http://vimeo.com/5737825

    What platforms? On Android there is or was a bug with audio latency that would interfere with your goals. The bug is in the Android OS IIRC. If you want to contact me offlist I can put together an AIR project to test mixing as many tracks as you'd like and include buttons to trigger them (source included).

  • Does Adobe Air support Mac OS X?

    When I try to run Adobe.com on Adobe Air (or another Air
    application, for that matter), the application crashes. I am
    running Mac OS 10.5.6.
    I was initially able to run Air applications. But as of last
    week or so, I cannot.

    Hello All,
    I had Adobe Air installed with three applications: Zinio, Mindomo & Prezi. Everything was working fine. I upgraded my Mac OS X leopard to Snow Leopard. Zinio asked to be upgraded to 4.0 and upon upgrading the app I was asked to upgrade to Adobe Air 2.5.1. After upgrades I receive the following error when I try to run any of the applications : "This application requires a version of Adobe AIR which cannot be found. Please download the latest version of the runtime from http://www.adobe.com/go/getair, or contact the application author for an updated version." followed by a crash, here is the crash report: http://www.box.net/shared/b003opfbmo
    I have tried the above steps, including uninstalling the applications, adobe air, running the terminals commands and then installing all again. Can anyone help?
    P.S. the same reproduces on another administrative account on the same machine.

  • Adobe Air Apps connection

    Forgive the amateur nature of this question if the answer is
    readily out there.
    As an Adobe AIR apps user, how do Adobe Air applications
    connect to the internet and how can this be configured...I don't
    seem to see a readily apparent shell application with settings that
    can be modified. I ask because here (in my workplace) I have
    internet capabilities, but because I function behind a firewall,
    the connection isn't open to any app on any port.
    (I'm running on XP, incidentally)
    Thoughts? Direction?

    AIR applications use the networking support provided by the
    underlying OS. On XP, any required configuration is done via the
    Internet Options control panel. Assuming your machine already
    configured to access the internet, no additional configuration
    should be necessary.
    Oliver Goldman | Adobe AIR Engineering

  • Does Adobe AIR for iOS support APNs?

    Does Adobe AIR for iOS support the Apple Push Notification Service (APNs)?
    for more information on APNs see:
    http://developer.apple.com/library/ios/#documentation/NetworkingInternet/Conceptual/Remote NotificationsPG/ApplePushService/ApplePushService.html

    It is exactly the same.
    Do I need to add the mobileprovision in any step of the resigning process?
    Inside the unpacjed ipa, i've fund a Info.plist.
    This seems to be the plist file generated from adt.
    Do I need to integrate my entitlement with the original one?
    <?xml version="1.0" encoding="UTF-8" standalone="no"?>
    <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
    <plist version="1.0">
        <dict>
            <key>CFBundleAllowMixedLocalizations</key>
            <true/>
            <key>CFBundleVersion</key>
            <string>0.0.0</string>
            <key>CFBundleShortVersionString</key>
            <string>0.0.0</string>
            <key>CFBundleIdentifier</key>
            <string>XXXXXXXX</string>
            <key>CFBundleInfoDictionaryVersion</key>
            <string>6.0</string>
            <key>CFBundleExecutable</key>
            <string>iBatteryExample</string>
            <key>CFBundleDisplayName</key>
            <string>iBatteryExample</string>
            <key>CFBundlePackageType</key>
            <string>APPL</string>
            <key>DTCompiler</key>
            <string>4.2</string>
            <key>DTPlatformBuild</key>
            <string>8C134</string>
            <key>DTPlatformName</key>
            <string>iphoneos</string>
            <key>DTPlatformVersion</key>
            <string>4.2 Seed 2</string>
            <key>DTSDKName</key>
            <string>iphoneos4.2</string>
            <key>DTXcode</key>
            <string>0325</string>
            <key>DTXcodeBuild</key>
            <string>10M2423</string>
            <key>LSRequiresIPhoneOS</key>
            <true/>
            <key>MinimumOSVersion</key>
            <string>4.0</string>
            <key>NSMainNibFile</key>
            <string>MainWindow</string>
            <key>NSMainNibFile~ipad</key>
            <string>MainWindow-iPad</string>
            <key>CFBundleResourceSpecification</key>
            <string>ResourceRules.plist</string>
            <key>UIStatusBarHidden</key>
            <false/>
            <key>renderMode</key>
            <string>auto</string>
            <key>CTRequestedDisplayResolution</key>
            <string>high</string>
            <key>DebugMode</key>
            <false/>
            <key>CTSoftKeyboardBehavior</key>
            <string>none</string>
            <key>CTNamespaceURI</key>
            <string>http://ns.adobe.com/air/application/3.0</string>
            <key>CTAutoOrients</key>
            <true/>
            <key>CTInitialWindowTitle</key>
            <string>iBatteryExample</string>
            <key>CTInitialWindowContent</key>
            <string>xxxxx.app/xxxxxxxx.swf</string>
            <key>CTMaxSWFMajorVersion</key>
            <string>13</string>
            <key>CFBundleSupportedPlatforms</key>
            <array>
                <string>iPhoneOS</string>
            </array>
            <key>UIDeviceFamily</key>
            <array>
                <string>1</string>
                <string>2</string>
            </array>
            <key>aps-environment</key>
            <string>development</string>
            <key>com.apple.developer.aps-environment</key>
            <string>development</string>
            <key>get-task-allow</key>
            <true/>
            <key>UIRequiredDeviceCapabilities</key>
            <array>
                <string>armv7</string>
                <string>opengles-2</string>
            </array>
            <key>UISupportedInterfaceOrientations</key>
            <array>
                <string>UIInterfaceOrientationPortrait</string>
                <string>UIInterfaceOrientationPortraitUpsideDown</string>
                <string>UIInterfaceOrientationLandscapeRight</string>
                <string>UIInterfaceOrientationLandscapeLeft</string>
            </array>
            <key>Extensions</key>
            <array>
                <string>myExtension</string>
            </array>
        </dict>
    </plist>
    as you can see it already contains the aps-environment value because I've added it in my appdescriptor file.
    Any idea?
    Thanks

  • Does Adobe AIR for Android support C2DM?

    Does Adobe AIR for Andoird support the Android Cloud to Device Messaging Framework (C2DM)?
    for more information on C2DM see:
    http://code.google.com/android/c2dm/index.html

    It isn't supported right now. It should be supportable (you will have to write native code) in an upcoming release. Same for iOS/Android notifications.

  • Does adobe AIR 13 support Windows mobile app?

    Does adobe AIR 13 support Windows mobile app?

    Please vote here for Universal Windows app support, and hopefully the Adobe people will listen:
    https://bugbase.adobe.com/index.cfm?event=bug&id=3787892

  • Does Adobe CreatePDF support Mac System 10 Leopard OS?

    Does Adobe CreatePDF support Mac System 10 Leopard OS?

    Good day,
    Adobe CreatePDF is a web-based service.  All you need is an internet connection, a modern browser and Flash Player installed.  You can see the full system requirements here: http://www.adobe.com/acom/systemreqs/
    Note - The CreatePDF desktop printer, which is an optional install for CreatePDF is a Windows-only feature.
    Please let us know if you have any questions.
    Kind regards,
    David

  • Does Adobe Prelude support USB3 video import?

    Does Adobe Prelude support USB3 video import?

    Hello Michael,
    Thank you for the response. I have used Adobe OnLocation before with a firewire camera and a laptop. My Panasonic HMC150 has HDMI output instead of Firewire. What I was hoping to do was to connect my camera via HDMI to the BlackMagic Intensity Shuttle and then to my laptop running Prelude via USB 3.0. Do you know if any Adobe Product supports USB 3.0 camera input streaming?
    Regards,
    Mark
    Date: Mon, 10 Sep 2012 11:53:29 -0600
    From: [email protected]
    To: [email protected]
    Subject: Does Adobe Prelude support USB3 video import?
    Re: Does Adobe Prelude support USB3 video import? created by michaelgoshey in Adobe Prelude - View the full discussion
    Hi Mark,
    Prelude can ingest assets from mountable drives/volumes seen by the OS. If the device you connect via USB3 is mounted by the OS I would expect no issues with Prelude ingesting from it.
    However, if you are referring to the possibility of Prelude capturing a live stream from and camera via USB3 then that is not something Prelude supports.
    Happy to answer other questions you may have on this.
    Regards,
    Michael
    Product Owner, Adobe Prelude
    Replies to this message go to everyone subscribed to this thread, not directly to the person who posted the message. To post a reply, either reply to this email or visit the message page: http://forums.adobe.com/message/4687454#4687454
    To unsubscribe from this thread, please visit the message page at http://forums.adobe.com/message/4687454#4687454. In the Actions box on the right, click the Stop Email Notifications link.
    Start a new discussion in Adobe Prelude by email or at Adobe Forums
    For more information about maintaining your forum email notifications please go to http://forums.adobe.com/message/2936746#2936746.

  • Adobe AIR support for Windows RT and USB

    We want to develop an cross platform application. We found that Adobe AIR supports cross platform development for Windows, iOS and Android.
    We wanted to know wheather
    1) reading and writing to USB port is possible with Adobe AIR?
    2) Adobe AIR has support for Windows RT development?
    Thanks in advance.

    I wrote before about my concerns with Adobe AIR, but here is a short summary:
    - no road map and no clear plans for the platform,
    - support of new devices is often late, Intel chipsets are not supported on Android,
    - debugging on a device is a pain,
    - inadequate build times for iOS, app package is quite large,
    - list of mobile UI components is very limited and UI experience is far from native,
    - native extensions are a possibility but still far from perfect (imagine using three very different development platforms all in one app), no debugging,
    - performance is not good if you use a lot of Spark components in your app,
    - Flash Builder is pretty bad as the development environment,
    - ActionScript3 is a poor, outdated language that encourages bad coding practices.
    I ruled out HTML5 frameworks for the same reason as you stated above. Last few months I've been working with Xamarin MonoTouch and I think it is perfect for my projects. 100% native UI experience, about 80% of the code is shared among the platforms, iOS, MacOSX, Android and Windows 8/RT are supported. Took me about 2 months to convert my 2Mb ActionScript Adobe AIR project to Xamarin MonoTouch (iOS). The entire process was fun and painless. Now thinking to port to MacOSX and Android. My iOS app is already at the App Store, no major complains so far.
    On a down side, Xamarin is expensive for an indie developer with low revenues. You need to pay $300 per year per each platform (iOS, Android, Mac). Plus, you need to develop UI layer separately for each platform, so only part of the code is shared. But I decided it is a way to go for my projects and it's been a very positive experience so far.
    As for my professional development, Xamarin offers quite a bit more as well. I get to work with C#, .NET, iOS SDK, Android SDK all in one platform. With Adobe tools you only get to know ActionScript and Flex/Spark framework. Very rarely I see that as a desired qualification. It is like a trap. Your boss tells you to develop a few projects with Adobe tools, it sucks you in for a few years and suddenly you realize that your market value declined dramatically and there is no easy way out of this mess.

  • Does Adobe still support Adobe Photoshop Elements 12 & Adobe Premiere Elements 12?

    Does Adobe still support Adobe Photoshop Elements 12 & Adobe Premiere Elements 12?

    No, but then they never do support PSE very much. What's the problem?

  • Does Adobe officially support running Photoshop on VMware?

    I need to convert from discrete servers running Photoshop for an image resizing function to a VMware/blade server environment.
    Does Adobe officially support running Photoshop on VMware?
    Also, what versions of ESX are currently tested and supported?
    I understand there may be some special configs needed to get the licenses to work....what are they?
    Also, if certain versions of Photoshop are supported and others are not supported under VMware, I need to know that as well.
    How do you get to a product manager at Adobe?....For Gods sake, they have a customer service blockade to get to a person who knows this stuff.
    Thanks,
    Cody

    CodyClaxton please see Technical support boundaries for virtualized or server-based environments - http://helpx.adobe.com/creative-suite/kb/technical-support-boundaries-virtualized-or.html for additional details regarding support which is available for virtual machines.

  • Adobe AIR Supported Lowest Performance Android Phone

    Hi,
    I am looking for an Adobe AIR supported lowest performance android phone for the purpose of testing game performance in development. Right now, I am thinking of Samsung Galaxy Mini 2. If you know any other lower one, please suggest.
    Thanks.

    AIR is compatible with Android 2.2 on ARMv7 devices.

  • Does adobe muse support ajax

    hi i need to know if does adobe muse support ajax!! if yes when can i read about it please!

    Hi,
    There is no native feature in Muse for ajax. However, if you can get your custom script, you an add it to your site.
    Regards,
    Aish

Maybe you are looking for

  • Windows XP/Vista on a Macbook

    Hi... I am very new to Mac. I have always used a PC. Finding OSX hard to get use to. Im just wondering if there is an XP/Vista version for Mac's? I cant seem to find it anywhere to buy. Also it is easy to use? Just install as you would anything? Than

  • How to build dynamically specified GUIs/Forms

    Dear forum members: As Flex newbie I still have got some questions concerning the Flex technology. I've got to modernize an existent catalog-based ordering system in which a ShopManager (the 1st kind of enduser and an "enduser programmer" at the same

  • Using computer variables in task sequence "Run Command Line"

    I am attempting to deploy VMs through VMware's vRealize Automation tool using CM. The process creates a CM computer object then creates a direct rule on a CM collection for the new computer object. During the creation of the computer object vRA creat

  • Cash journal - Credit card payment

    Hello colleagues, Want some light in posting CR/DR card payments in AR... Cash journal does not accept this payment method... Any help is highly appreciated. THnks,

  • Wrong language HP M476nw

    Hi, I have a hp laserjet pro M476nw and I choosed wrong language, when I started to install the printer, and of all languages it was chineese and thats not so easy to understand . Can somebody help me, please? Maybe someway to restart...