Monday, June 6, 2011

Faster Flex Compilation with Flash Builder 4.5

The Flex 4.5 SDK compiler is slightly faster and more conservative about memory compared to its previous version. There are a couple of small changes that a developer can make to speed up compilation. One of them involves a new compiler option and others are related to organizing code in your project and can be leveraged by customers on the 4.0 SDK as well. 

The New Compress Option (non-mobile projects only)

SWF files can be compressed or uncompressed. SDK 4.5 exposes a compiler option to control whether the output SWF is compressed or uncompressed. Try setting -compress=false in Project properties -> Flex Compiler -> Additional Compiler arguments.

Before you go ahead and set this, note the caveats:
  1. Flash Builder automatically sets this option for Mobile projects (and removes it on an Export Release build).
  2. If you set the option, you'll have to remove the option before exporting a release build unless you are fine with 2x - 10x increase in SWF size.
  3. Strangely, we found Flex runtime performance implications when an uncompressed SWF was generated. This requires more investigation, but it is something that must be kept in the back of your mind and the reason why this is not the default behavior.
The numbers: 2239ms before and 1734ms after (On a large customer project when making an incremental change of width in MXML). That is roughly 22%, but your mileage will vary depending upon the actual contents of your project. Normal projects are unlikely to give this drastic an improvement in compilation speed.

For Free consultation on regarding Flex Development, Flex Experts, Flex Programmers, Flex Designers log on to

1 comment:

  1. Well this is very interesting indeed. Would love to read a little more of this. Great post. Thanks for the heads-up. This blog was very informative and knowledgeable.

    joomla extension