Posted by Rob Christensen
Arno Gourdol, a member of the AIR engineering team, has posted an excellent blog entry titled Writing Well-behaved, Efficient, AIR Applications. Whether you are just beginning to build your first Adobe AIR application or already have deployed one to your users, this article provides some excellent suggestions on how to optimize the performance of your applications.
- Posted on May 07, 2009 at 2:16 PM
Posted by Rob Christensen
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:
- 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.
- 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.
- Use Timer whenever possible instead of enterFrame handlers. The later are expensive and are called often.
- 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:
- Posted on May 07, 2009 at 1:26 PM
Posted by Rob Christensen
The TweetDeck team recently launched version 0.25 of their popular desktop Twitter client powered by Adobe AIR. The latest version includes several impressive new features including Facebook integration, the ability to record video clips within TweetDeck using 12seconds and memory leak fixes. We had the pleasure to work closely with the TweetDeck team to help investigate a memory leak that was impacting quite a few users.
The TweetDeck team discusses new features on their blog and mentions the collaboration:
We’ve been listening and working hard, together with Adobe, making improvements to TweetDeck to fix the memory leak. Today we’re delighted to be able to tell you that the memory leak has been plugged and now the latest version of TweetDeck will peak at a certain level and won’t go any higher. So you can leave your TweetDeck running all day, all night, or forever if you really want to.
We often receive questions around memory and we are working on putting together some best practices for developers. If you have tips you would like to share, please feel free to post a comment or send us your bugs directly (simple test cases are much appreciated). If you are building your application using Flex Builder, the profiler can be extremely helpful in tracking down memory issues in your application (see profiler documentation).
Also, be sure to check out the Performance-tuning Adobe AIR Applications article on the Adobe Developer Connection.
Again, congratulations to the TweetDeck team on the release!
- Posted on April 23, 2009 at 2:45 PM
Oliver Goldman has written an excellent article titled Performance-tuning Adobe AIR Applications that is now available on the Adobe AIR Developer Center. The article explores how to define metrics, measure throughput and memory, and apply an optimization process to your development process.
It's a must read article whether you have already deployed an AIR application to your customers or you are simply in the early stages of thinking about building an AIR application.
If you have thoughts or experiences you would like to share, positive or negative, with regard to the performance of your AIR application, please feel free to leave a comment. If you think you have encountered a bug in this area, let our team know directly by sending us a description of your issue to our wish list.
In the coming months, we plan on sharing more articles that describe how to optimize the performance of your applications.
- Posted on March 09, 2009 at 3:39 PM