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:
fast-3.0.zip
fast-3.1.zip
fast-3.2.zip
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:
Performance Numbers
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.
fast-3.1.diff
fast-3.2.diff
fast-experimental-3.0.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 3.0.1.1092, fast-3.1.zip is based off of 3.1.0.2710, fast-3.2.zip is based off of 3.2.0.3958, and and fast-experimental-3.0 is based off of 3.0.1.1092. The 3.0.1.1092 version was used for the Flex 3.0 changes because 3.0.0.477 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.
Comments (23)
I assume that this will void the ability to use framework caching.
Posted by Rich Tretola | October 27, 2008 4:49 AM
Posted on October 27, 2008 04:49
It does not change any framework code, only compiler code. So it should work fine with framework caching.
Posted by Brian Deitte | October 27, 2008 6:32 AM
Posted on October 27, 2008 06:32
This is great. Are any of the changes portable to the 3.2 release?
Posted by diamondTearz | November 17, 2008 10:45 AM
Posted on November 17, 2008 10:45
All of these changes are portable to the 3.2 release, and someone else should feel free to port them! :) I don't know when I'll get to that myself, but if there's a big desire for this, just comment to let me know.
Posted by Brian Deitte | November 18, 2008 3:32 AM
Posted on November 18, 2008 03:32
Now I've started using 3.2. So I am waiting you to port your patch with great impatience ;)
Posted by yk | November 25, 2008 3:50 AM
Posted on November 25, 2008 03:50
I'd be really grateful if you could port this to 3.2. That's the only thing that's keeping me from updating.
Actually, Adobe should add those performance improvements in 3.3 or something like that. When you are working with larger projects the time to compile consumes too much of our precious time.
Posted by Gerhard | December 11, 2008 3:52 AM
Posted on December 11, 2008 03:52
Alright, so I think we have the needed quorum. I don't have time until Tuesday, but I'll try to get this done and posted this week. If that doesn't happen... please pester me about it!
Posted by Brian Deitte | December 14, 2008 7:39 PM
Posted on December 14, 2008 19:39
Well, I guess it's time to start pestering ... ;-)
I hope you'll soon find the time to port the changes to 3.2
Posted by Gerhard | December 25, 2008 7:41 AM
Posted on December 25, 2008 07:41
And you have every right to pester. :) I started to do it two days ago, but the merge wasn't as easy as the last time. I'm probably doing something differently, but I didn't figure out what. I haven't had much time otherwise, but I will try again this weekend. Sorry about the wait!
Posted by Brian Deitte | December 26, 2008 9:08 AM
Posted on December 26, 2008 09:08
This blog post has been updated with the files for 3.2. Let me know if you see any problems.
Posted by Brian Deitte | December 27, 2008 12:32 PM
Posted on December 27, 2008 12:32
This is indeed my favorite entry from the year in your blog. Thanks for updating to 3.2 Happy New Year!
Posted by diamondTearz | January 1, 2009 2:39 PM
Posted on January 1, 2009 14:39
Thanks, and thanks for the post about Mashable on your web site (the info for others: http://diamondtearz.org/blog/2008/12/31/mashable-wants-you-to-post-a-link-to-your-best-blog-entry/ )
Posted by Brian Deitte | January 1, 2009 6:03 PM
Posted on January 1, 2009 18:03
Hi, there is problem using this fast SDK.
When I am using handler.apply(null, args ); it throwing argument mismatch error, in default SDK 3.2 or 3.3 , it works correctly.
Posted by B.Moss | March 4, 2009 7:46 AM
Posted on March 4, 2009 07:46
B. Moss, that's a new one to me. Can you post the exact error message? Have you tried this in Flex 4? Since this is code taken from Flex 4, I wonder if it's been fixed there. And if not, it'd be great to enter it at http://bugs.adobe.com/flex
Posted by Brian Deitte | March 7, 2009 10:11 AM
Posted on March 7, 2009 10:11
Hi, I wonder if there would be an update for Flex 3.3 SDK. :) I really enjoy the speed improve in your mod. Thanks.
Posted by Tangent | May 11, 2009 2:46 PM
Posted on May 11, 2009 14:46
Tangent, thanks for the reminder, as I forgot that I was going to update this to 3.3. I'll see when I can squeeze it in, but unfortunately I'm not sure when this will happen yet!
Posted by Brian Deitte | May 11, 2009 6:07 PM
Posted on May 11, 2009 18:07
Also, I find that smart (liberal) use of modules greatly helps workflow speed.
Posted by Brenden Sawyer | May 27, 2009 3:18 AM
Posted on May 27, 2009 03:18
As Flex SDK 3.4 will be the last 3.x release, it could be very nice to have and update for 3.4 release.
Is it possible ?
Posted by Bouiaw | September 30, 2009 5:34 PM
Posted on September 30, 2009 17:34
Bouiaw, I didn't know that 3.4 was the last release of 3.x. Just curious, where did you see that?
Since I never did get around to a 3.3 update, I'm not going to promise anything for 3.4. But I hope to get to this and will put it on my TODO list.
Posted by Brian Deitte | September 30, 2009 6:59 PM
Posted on September 30, 2009 18:59
From here : http://opensource.adobe.com/wiki/display/flexsdk/Download+Flex+3
Posted by Bouiaw | October 3, 2009 2:11 PM
Posted on October 3, 2009 14:11
Bouiaw, I misunderstood. I thought you meant "the last 3.x release ever", and you meant "the latest 3.x release". Yeah, I definitely should update to 3.4, but it's just not on the top of my TODO list right now. I feel like many people are going to start using a beta of FB4, given that there likely will be something that comes out at Adobe MAX, and there's just two many interesting things I'm doing at the moment. :) It's not super hard to make these changes yourself, given all the info in this post. I would guess it would take someone a few hours to do it. And I haven't given up on doing it myself!
Posted by Brian Deitte | October 4, 2009 4:05 PM
Posted on October 4, 2009 16:05
Please, exist an update for SDK 3.5 ?
Thanks
Posted by Joao Lopes | October 21, 2010 9:08 AM
Posted on October 21, 2010 09:08
Sorry but I haven't made any updates to this in awhile. You could rebuild this yourself using the diffs above, and I'm sure a lot of people would be happy to use it. And I would be happy to point to any blog post on this.
Posted by Brian Deitte | October 23, 2010 2:46 PM
Posted on October 23, 2010 14:46