At Brightcove I've spent some time creating faster Flex 3 SDKs by merging some changes from the Flex 4 SDK. It's not a lot of changes, but it makes a fairly significant improvement in compilation speeds in Flex Builder. I find for small changes in a large project, there's about a
20%25% speedup, but this varies greatly depending on what you're doing. I'll give some performance numbers below and explain exactly what changed, but first I'll show you how you can use these changes yourself.
Using the Changes
Here are the files you'll need, with one zip file for Flex 3.0, Flex 3.1, and Flex 3.2:
Inside of the zip files you'll find jars that should overwrite existing files in FLEX_SDK/lib, where FLEX_SDK is the location of the Flex SDK you are using. If you are unsure of this location and you are using Flex Builder, you can find it in the "Properties" for your project. Select "Flex Compiler", then select "Configure Flex SDKs". If you "Edit" the SDK listed, you'll see it's location.
There's another zip file that you can try out, which contains some more changes from Flex 4. Given the number of changes, I've labeled it experimental. There's only a Flex 3.0 version:
For fast-3.0.zip, I ran some tests on the building of the media module at Brightcove:
Changing the main MXML file: from 13 seconds to 8 seconds
Changing two UI classes: from 41.5 seconds to 34.5 seconds
Changing a ModelLocator: from 47 seconds to 39 seconds
Why I Did This
Now that I've given out the files and shown the performance, I'm sure I've lost half of the readers as they go update their SDK. But for those of you still here, I'll explain things more. As you may have seen in a recent post of mine about ways to speed up Flex Builder, I've been working on strategies at Brightcove for increasing everybody's ability to work quickly on Flex and AS3 projects. As a part of this, I've been very interested in the Flex 4 performance changes.
I talked to Paul Reilly and Pete Farland at Adobe a bit about my work, and they thought what I was planning to do made sense. Paul also suggested that I try to use Flex 4 directly. I did try this, but I ran some issues. It also just wouldn't work out to have everyone use the pre-alpha of Flex 4 on a large codebase at Brightcove. But I still wanted to use some of the performance changes. That's not a problem when a project is open source, thankfully! I used svn to merge some of the changes back to Flex 3, and we've been using these changes at Brightcove since then.
More on the Changes
Here's are the diffs for fast-3.1.zip and fast-experimental-3.0.zip. I'd have to remake the changes to get the diffs for fast-3.0.zip, but I believe they're identical to fast-3.1.diff and fast-3.2.diff.
The subversion changes I merged for the fast versions: 2850,2931,2941,3290,3369
The subversion changes I merged for the experimental version: 1237,2001,2627,2673,2850,2931,2941
fast-3.0.zip is based off of 126.96.36.1992, fast-3.1.zip is based off of 188.8.131.5210, fast-3.2.zip is based off of 184.108.40.20658, and and fast-experimental-3.0 is based off of 220.127.116.112. The 18.104.22.1682 version was used for the Flex 3.0 changes because 22.214.171.1247 doesn't have the asc compiler. There are barely any changes between the two versions of the compiler.
The experimental version had a lot of merge conflicts that I'm not positive I merged correctly. I've been using it myself a lot, and it's definitely faster. I can't wait to see the speed of Flex 4, which has a lot more changes that I didn't try to merge.