O'Reilly logo

Professional Adobe® Flex® 3 by Joe Berkovitz, David Hassoun, Andrew Trice, Tom Sugden, Todd Prekaski, Jun Heider, Peter Ent, Joseph Balderson

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Chapter 67. Application Performance Strategies

There's no question about it — everyone wants their application to be the fastest. It should start up quickly, it should load data quickly, it should render data quickly, it should be able to crunch numbers quickly, and it should not use much memory. When developing your Flex applications, it is often easy to overlook simple pitfalls that can be detrimental to your application's performance. This chapter highlights strategies for building applications that perform well and identifies simple mistakes that can cause large impacts on application performance.

Understanding Object Creation Policies

One small change that can have a potentially disastrous affect on application startup performance is changing the creation policy of a container object. By default, all container objects use a deferred creation policy. This means that objects are only created as they are needed.

For example, consider a TabNavigator component. If TabNavigator contains multiple children, only the children of the first tab are actually created upon initialization of the tab navigator instance. In the following code snippet, only the children of the first canvas would be created upon initialization.

<mx:TabNavigator>

   <mx:Canvas label="Tab 1">
      <!-- various child components here -->
   </mx:Canvas>

   <mx:Canvas label="Tab 2">
      <!-- various child components here -->
   </mx:Canvas>
<mx:Canvas label="Tab 3">
      <!-- various child components here -->
   </mx:Canvas>
</mx:TabNavigator>

The ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required