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 ...

Get Professional Adobe® Flex® 3 now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.