Performance Tips for Adobe AIR

Post Update: Be sure to check out the blog post Writing well-behaved, efficient, AIR applications by Arno Gourdol that provides more details on some of the tips suggested below.

As more Adobe AIR applications are being built, one piece of feedback that we hear from developers is that the idle CPU for basic AIR applications on the Mac is too high. Today, Flash developer Grant Skinner wrote a blog post sharing his concerns around the excessive CPU usage of Adobe AIR and Flash Player applications on the Mac — particular in the case of a simple application.

First, I want to thank Grant for not only sharing his concerns, but also for directing developers to use the open Flash Player bug database to report their issues. When the developer community votes on bugs that have the biggest impact, this helps send valuable data back to our development teams on what the community believes to be the most important issues. Though Adobe AIR does not have a public database yet, we request that you use our feedback form to report bugs and feature requests. These issues come directly to our team and we do our best to reproduce every bug that comes in.

Second, I also want to be clear that reducing CPU usage on the Mac is an area that we are making investments in the next version of Adobe AIR and Flash Player. This is an important issue for us to address and we are focused on making improvements in this area (we hear you Grant and we’re already working on it :).

Finally, as we talk to developers building Adobe AIR applications, we have come up with a few tips that can help improve the performance of your applications: 

  1. Try to use the smallest "frameRate" possible in your application. To do this, set stage.frameRate or mx:WindowedApplication attribute of your application. This will help reduce the overall amount of CPU usage for applications.
  2. When your application is in the background, set "stage.frameRate = 1;" as it will reduce CPU usage to < 1% 2.To be notified when an Adobe AIR application goes into the background: "this.addEventListener(AIREvent.APPLICATION_DEACTIVATE, appDeactivate);" Grant has put together a simple class that does this for you.
  3. Use Timer whenever possible instead of enterFrame handlers. The later are expensive and are called often.
  4. If you are building a Flex-based application, use the Flex Builder profiler to identify optimizations that can be made in your code. By doing so, you might find that you are, for example, invoking network calls more frequently than you need to.

If you have other tips, please feel free to share. We are planning to create a more comprehensive FAQ that provides guidelines on how to improve the performance of your applications. 

Also, be sure to check out the following links for other tips and tricks: 

34 Responses to Performance Tips for Adobe AIR

  1. venkat says:

    What happens to operations running in the background when the framerate is set to a low value? For example, if I am uploading a large file in AIR but the air window is deactivated and I set the framerate to 1? Will it slow down the upload?

  2. venkat says:

    What happens to operations running in the background when the framerate is set to a low value? For example, if I am uploading a large file in AIR but the air window is deactivated and I set the framerate to 1? Will it slow down the upload?

  3. venkat says:

    What happens to operations running in the background when the framerate is set to a low value? For example, if I am uploading a large file in AIR but the air window is deactivated and I set the framerate to 1? Will it slow down the upload?

  4. Arno says:

    They are not affected.

  5. Arno says:

    They are not affected.

  6. Arno says:

    They are not affected.

  7. Dave says:

    As an idea: why not allow the possibility of setting the frame rate to zero?

  8. Dave says:

    As an idea: why not allow the possibility of setting the frame rate to zero?

  9. Dave says:

    As an idea: why not allow the possibility of setting the frame rate to zero?

  10. there is also an issue with the number of display objects on stage. the more display object and the higher the framerate the higher the cpu utilisation rises up.
    if you can set mouseEnable to false this could reduce cpu usage.
    for more details see (and vote for) the bug report at adobe:
    http://bugs.adobe.com/jira/browse/FP-1149

  11. there is also an issue with the number of display objects on stage. the more display object and the higher the framerate the higher the cpu utilisation rises up.
    if you can set mouseEnable to false this could reduce cpu usage.
    for more details see (and vote for) the bug report at adobe:
    http://bugs.adobe.com/jira/browse/FP-1149

  12. there is also an issue with the number of display objects on stage. the more display object and the higher the framerate the higher the cpu utilisation rises up.
    if you can set mouseEnable to false this could reduce cpu usage.
    for more details see (and vote for) the bug report at adobe:
    http://bugs.adobe.com/jira/browse/FP-1149

  13. Jed says:

    it might be worth noting that if you’re developing your AIR app in flash CS4 you can still use the flex builder profiler via the profile > profile external application option in flex builder …

  14. Jed says:

    it might be worth noting that if you’re developing your AIR app in flash CS4 you can still use the flex builder profiler via the profile > profile external application option in flex builder …

  15. Jed says:

    it might be worth noting that if you’re developing your AIR app in flash CS4 you can still use the flex builder profiler via the profile > profile external application option in flex builder …

  16. Question – I’m trying to lower my app’s memory usage – I believe that the Sound class is trying to load the entire 200MB MP3 file into memory. Is there another way to play large local audio files without loading them completely into memory (or running a local RED5 server).

    Thanks!

  17. Question – I’m trying to lower my app’s memory usage – I believe that the Sound class is trying to load the entire 200MB MP3 file into memory. Is there another way to play large local audio files without loading them completely into memory (or running a local RED5 server).

    Thanks!

  18. Question – I’m trying to lower my app’s memory usage – I believe that the Sound class is trying to load the entire 200MB MP3 file into memory. Is there another way to play large local audio files without loading them completely into memory (or running a local RED5 server).

    Thanks!

  19. myneni says:

    i am trying to build a air application with full screen mode .
    In my application i am playing videos, swf, and images continuously. The os is Ubuntu and cup is intel thin client.
    My problem is the air application stucks after 6 hrs, some times with in one hour. I made lot of changes to reduce memory usage.
    Its working well in the windows machine but in linux machine it goes worest.

    MY question is that linux and intel atom process are sufficient to play air applications in fullscreen mode?

  20. myneni says:

    i am trying to build a air application with full screen mode .
    In my application i am playing videos, swf, and images continuously. The os is Ubuntu and cup is intel thin client.
    My problem is the air application stucks after 6 hrs, some times with in one hour. I made lot of changes to reduce memory usage.
    Its working well in the windows machine but in linux machine it goes worest.

    MY question is that linux and intel atom process are sufficient to play air applications in fullscreen mode?

  21. myneni says:

    i am trying to build a air application with full screen mode .
    In my application i am playing videos, swf, and images continuously. The os is Ubuntu and cup is intel thin client.
    My problem is the air application stucks after 6 hrs, some times with in one hour. I made lot of changes to reduce memory usage.
    Its working well in the windows machine but in linux machine it goes worest.

    MY question is that linux and intel atom process are sufficient to play air applications in fullscreen mode?

  22. DS Games says:

    very good selection. useful for me. Thanks

  23. DS Games says:

    very good selection. useful for me. Thanks

  24. DS Games says:

    very good selection. useful for me. Thanks

  25. I am glad to be a visitant of this everlasting web site! , regards for this rare info ! .

  26. I am glad to be a visitant of this everlasting web site! , regards for this rare info ! .

  27. I am glad to be a visitant of this everlasting web site! , regards for this rare info ! .

  28. I was studying some of your articles on this internet site and I think this internet site is rattling informative ! Continue putting up.

  29. I was studying some of your articles on this internet site and I think this internet site is rattling informative ! Continue putting up.

  30. I was studying some of your articles on this internet site and I think this internet site is rattling informative ! Continue putting up.

  31. Lien Ganas says:

    Strange… I just stumbled on your website by searching for ‘financial spreadbetting’ on Google. But I can’t see any posts about that on here?

  32. Lien Ganas says:

    Strange… I just stumbled on your website by searching for ‘financial spreadbetting’ on Google. But I can’t see any posts about that on here?

  33. Lien Ganas says:

    Strange… I just stumbled on your website by searching for ‘financial spreadbetting’ on Google. But I can’t see any posts about that on here?

  34. When I click on your RSS feed it throws up a ton of strange characters, is the problem on my end?