« Brightcove 3 Now Available | Main | Flex 3 SDK: Now Even Faster »

A Faster Flex 3 SDK

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:

fast-experimental-3.0.zip

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.

It does not change any framework code, only compiler code. So it should work fine with framework caching.

This is great. Are any of the changes portable to the 3.2 release?

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.

yk:

Now I've started using 3.2. So I am waiting you to port your patch with great impatience ;)

Gerhard:

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.

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!

Gerhard:

Well, I guess it's time to start pestering ... ;-)
I hope you'll soon find the time to port the changes to 3.2

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!

This blog post has been updated with the files for 3.2. Let me know if you see any problems.

This is indeed my favorite entry from the year in your blog. Thanks for updating to 3.2 Happy New Year!

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/ )

B.Moss:

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.

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

Hi, I wonder if there would be an update for Flex 3.3 SDK. :) I really enjoy the speed improve in your mod. Thanks.

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!

Also, I find that smart (liberal) use of modules greatly helps workflow speed.

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 ?

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.

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!

Joao Lopes:

Please, exist an update for SDK 3.5 ?
Thanks

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.