Allen Ellison’s Technobabble


Improving ADL performance on Macs
July 19, 2012, 10:35 am
Filed under: ActionScript 3, Adobe AIR, Adobe Flash, Gaming, Performance | Tags: , , ,

When I was doing some performance benchmarking with Starling, I noticed that the AIR runtime performance when invoked from within Flash Builder was only 5% of the performance when running on the AIR desktop runtime.  Adobe Flash Builder invokes ADL when previewing application content.  The reason that ADL is running so slow is because it runs in debug mode by default.

But you can make ADL run just as fast in AIR on the desktop.

So, how do you tell ADL to not run in debug mode?  When invoking ADL from the command line, that’s simple.  Just pass in -nodebug flag.

In the Flash Builder launch configuration properties panel, you can specify command line arguments.  But these command line arguments aren’t for ADL, they’re passed through ADL and are intended for the AIR application being invoked.

While I’m sure this will get addressed in an upcoming release, here’s a workaround for those using older versions, including Flash Builder 4.6 (this work-around will work for Macs, although a similar “batch file” approach should work for Windows):

  • You should first make sure that you can RUN your AIR application using ADL before you proceed.  If you can’t successfully RUN your application, I strongly advise against taking the following steps.
  • Identify the SDK you are using (will be in the directory /Applications/Adobe Flash Builder 4.6/sdks), and open up it’s bin folder.  Rename the existing adl as adl-original, and create a new ‘adl’ with the following contents:
#!/bin/sh

# get the full path to the SDK's bin folder

DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"

# call the original adl 
# but insert the –nodebug parameter as the third argument

shift 2;
"$DIR"/adl-original "${1}" "${2}" -nodebug "$@" 

  • After you save the file, using the Terminal application (ensuring that you are in the same directory), type the following to give the new adl execute permissions.
chmod +x adl
  • ADL requires the first two parameters being passed to be preserved in order, and if any command line parameters are specified, then ADL is passed “–” and therefore it effectively ignores all parameters thereafter and wouldn’t see an appended –nodebug flag.  So what this script does is ensures that -nodebug is inserted as the third parameter.
  • Test to make sure that this change was implemented correctly by running your AIR application from within Flash Builder (under the application’s main menu “Run”, select “Run”).  You shouldn’t notice anything different (except that it’s faster of course).
  • Remember that this will only affect projects which use this specific SDK.  Unfortunately, as it currently stands, it will be applied to both RUN and DEBUG invocations of your AIR application via ADL.
  • If you run into issues, you can always restore your Adobe Flash Builder environment to its original configuration by deleting the new ‘adl’ that was created and renaming ‘adl-original’ as ‘adl’. If you want to troubleshoot your script, you can always insert lines like ‘echo (“!@”) >> adl_output — by default, this file will get created in /Applications/Adobe Flash Builder 4.6/Adobe Flash Builder 4.6.  You also should be able to use stderr and return an error code to get your information placed into a Flash builder dialogue (although I haven’t tried this).

Disclaimer: My opinions and statements are my own and do not reflect the opinions, etc. of my employer.

About these ads

Leave a Comment so far
Leave a comment



Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Connecting to %s



Follow

Get every new post delivered to your Inbox.

Join 632 other followers

%d bloggers like this: