Stop Coding!

The Unofficial Flex Compiler Blog

HFCD: Pick Your Compiler Speed! How about 10X!

with 5 comments

In my first blog post (A New Version of HFCD) of this year, I mentioned that the latest version of HFCD, currently in beta, supports out-of-process, multi-core compilation of Flex applications and libraries for Flex/Flash Builder. I am going to present some performance results here.

As you all know, Flex/Flash Builder uses an in-process compilation strategy. If there are multiple projects in the workspace, Flex/Flash Builder will build the projects sequentially. From Flex/Flash Builder’s perspective, building sequentially is a reasonable strategy because, as a GUI application, it needs to stay responsive and that means it can not use up all the available processor resources. Unfortunately, that also means, if you use a dual-core machine, Flex/Flash Builder uses one core. If you use a quad-core machine, Flex/Flash Builder still uses one core. There is no correlation between the Flex/Flash Builder build performance and the number of processor cores in your machine.

HFCD takes a totally different approach. HFCD analyzes applications’ and libraries’ dependencies in your workspace; figures out the maximum possible concurrency level and then use all the available processors** in your machine to build. This usually results in shortened project build time.

To best illustrate this idea, let’s take a look at the demos below. The workspace consists of 8 IBM ILOG Elixir demos. These projects are independent of each other.

ilog8

This is considered the best-case scenario because you can reach full CPU utilization right at the start and throughout the entire build. Now, let’s check out the performance results… The last setup is almost 10X faster than the first setup, which is currently the most common setup out there!

Setup Number of Processors Build Time
Flex Builder 3, Flex 3.4.1 2 35s
Flex Builder 3, Flex 3.4.1, HFCD 3 2 24s
Flex Builder 3, Flex 3.4.1, HFCD 3 4 12s
Flash Builder 4, Flex 4.0.0 2 12s
Flash Builder 4, Flex 4.0.0, HFCD 4 2 7.7s
Flash Builder 4, Flex 4.0.0, HFCD 4 4 3.9s

You can see big improvement by moving from Flex 3 to Flex 4, but that does not mean that HFCD is DOA. Instead, HFCD adds performance boost on top of Flex 4! In this scenario, HFCD makes the build run 50% faster (24s vs. 35s and 7.7s vs. 12s) by using the same hardware and 3X faster (12s vs. 35s and 3.9s vs. 12s) by doubling the number of processors!

A quick note on the performance improvement in the Flex 4 compiler. The triple-digit-percentage speed-up from Flex 3 to Flex 4 (35s vs. 12s) is likely due to the use of global LibraryCache. However, if LibraryCache is shared by bigger projects, the effect of LibraryCache will be significantly reduced.

Now, before you get too excited about the potential of multi-core compilation of Flex apps, you need to understand that the project dependencies play a key role in the build performance. For example, if your project dependency graph forms a straight line, then adding more CPUs is not going to help. If one or two projects in your workspace are dominating the total build time, consider breaking them up into smaller, independent projects.

I hope you find the test results useful…

** It is possible to configure HFCD to use less than the number of available processors. This configuration is useful for those who use quad-core machines as their development platforms by setting the concurrency level to 3 or 2.

Written by Clement Wong

October 20, 2009 at 9:47 pm

5 Responses

Subscribe to comments with RSS.

  1. […] After using the compiler in Flex 4 for a few days, I can see that the compiler is faster than its Flex 3 counterpart. Congrats to the folks at Adobe on this achievement. But since HFCD uses whatever is improved in Flex and it’s architected differently (and of course, with the use of multi-core technology), HFCD continues to outperform Flex in most medium-to-large project workspace situations. The build performance when combining Flash Builder 4, Flex 4 and HFCD 4 is truly amazing and I had already talked about it awhile back. […]

  2. […] 4 for Flash Builder achieves better Flex (full and incremental) build performance than Flex 3 and Flex 4 by […]

  3. Hi I was wondering if I could get a temp license for the product?

    Thanks,
    Tim

    tim

    February 11, 2011 at 5:30 pm

    • Me to I need temp licence for this write me please at naucnik1977 et yahoo dot com, i try over web page but with some error.

      adrijanakokoro

      April 23, 2012 at 7:59 pm

  4. I had requested for license, but I hadn’t got my license via email….
    Please do needful…I want to try it out…

    Mitul Golakiy

    April 15, 2013 at 8:45 am


Leave a comment