HFCD 3/4 Trial Period Extended

HFCD 3 and 4 trial period is going to expire this weekend, so I’m putting out another update. The update extends the period to the end of November.

HFCD 3: http://stopcoding.org/hfcd/3/download

HFCD 4: http://stopcoding.org/hfcd/4/download

Before you install this update, please do the following:

  1. Uninstall the Flex/Flash Builder plugin. You can do it by clicking “Help” –> “Software Updates” –> “Manage Configuration”. Then right-click the “HellFire Compiler” plugin to uninstall (please check out the screenshot below).
  2. Delete the “HellFire Compiler 3″ and “HellFire Compiler 4″ directory.
  3. If you used the Mac installer, you may also want to remove USER_HOME/Library/Receipts/hfcd3.pkg and USER_HOME/Library/Receipts/hfcd4.pkg.

uninstall

The last update wasn’t quite useful because I messed up at one place in the code when I was trying to clean up the code. That totally messed up the SWC project support. But it’s now fixed. Also, the socket connection between hfcd and Flex/Flash Builder is more stable now that you can start hfcd and Flex/Flash Builder in any sequence.

After the installation, please check out this previous post (How To Setup Your Projects for HFCD). Most developers forgot to close and open their projects after switching to HFCD. A few of them forgot to explicitly specify files that are not managed by Flex/Flash Builder in the “HFCD FileSet” view.

Leave a Comment

How To Setup Your Projects for HFCD

Howdy, some developers are having difficulties setting up their Flex Builder projects to use HFCD. I hope to address this by producing more documentation in the coming weeks. In the meantime, I hope to use the following example to explain how to setup your projects for HFCD. It should be pretty straightforward…

This example uses one of the IBM ILOG Elixir samples, heatmap.

1. Assume that you have ILOG Elixir installed (e.g. /Applications/IBM/ILOG/Elixir 2.5). In Flex Builder, import “Existing Projects into Workspace”. Select /Applications/IBM/ILOG/Elixir 2.5/samples/heatmap. Check “Copy projects into workspace”.

s1

2. Once the project is loaded, you should see in the HFCD console window that the heatmap project files are being ‘uploaded’ to HFCD.

[Thu Oct 22 12:40:12 EDT 2009] upload() count=2 total=541 time=1
[Thu Oct 22 12:40:12 EDT 2009] upload() count=74 total=1624755 time=66

Also, check out the project properties. Please take a look at ‘Flex Build Path’. You should see ilog-elixir.swc and ilog-elixir_rb.swc in the library path.

s2

3. The SWC files are in /Applications/IBM/ILOG/Elixir 2.5/frameworks. But the heatmap project that you’ve just imported is in, e.g. in my case, /Users/clement/Documents/Flex Builder 3/elixir-sample-heatmap. The SWC files are explicitly specified and are not managed by the Eclipse resource manager. That means, HFCD would not know about them. In fact, any files that the project workspace does not know about would not be “uploaded” to HFCD. To address this issue, you can use the “HFCD FileSet” view.

s3

4. Click ‘Windows’ –> ‘Other Views…’ and you should see the “HFCD FileSet’ view at the bottom. There is a pull-down menu at the top-right corner (that little inverted triangle) of the “HFCD FileSet” view. Click the pull-down menu and select ‘Add Directory’.

s6

5. Add /Applications/IBM/ILOG/Elixir 2.5/frameworks to the “HFCD FileSet” view.

s5

6. Go back to the pull-down menu and select “Upload Files”. This step “uploads” the SWC files to HFCD.

[Thu Oct 22 12:45:32 EDT 2009] upload() count=2 total=2486244 time=52
[Thu Oct 22 12:45:32 EDT 2009] upload() count=2 total=16330 time=2
[Thu Oct 22 12:45:32 EDT 2009] upload() count=2 total=14402 time=2
[Thu Oct 22 12:45:32 EDT 2009] upload() count=3 total=0 time=0
[Thu Oct 22 12:45:32 EDT 2009] upload() count=2 total=694230 time=14
[Thu Oct 22 12:45:32 EDT 2009] upload() count=4 total=0 time=0

The “HFCD FileSet” view will then show the number of files being “uploaded”.

s7

Behind the scene, the files in /Users/clement/Flex Builder 3/elixir-sample-heatmap and /Applications/IBM/ILOG/Elixir 2.5/frameworks are copied to /Users/clement/.hfcd/files. It is where HFCD locates and compiles the files.

7. At this point, HFCD should have all the files it needs to compile heatmap. Now, start a new, clean build.

s9

8. If there is nothing wrong, the heatmap app will be compiled successfully and you should see it in the “HFCD View” view.

s10

9. Test the app by selecting ‘heatmap.html’ in the ‘bin-debug’ directory.

s12

Hope you find this useful. Also, this previous post (http://stopcoding.wordpress.com/2009/10/09/using-flex-builder-with-hfcd) talks about the very same topic. Please check it out.

Comments (2)

HFCD Upgraded to Support Flex 4.0.0 Beta 2

Some developers told me that they were interested in using HFCD with Flash Builder. They’ve already moved to Flash Builder beta as their primary development tool and they would really like to see HFCD support for Flex 4. I initially was a bit cautious about integrating HFCD (currently in beta) with Flex 4 (also currently in beta). But in the past couple of weeks, I looked at the compiler code in Flex 4 and thought “hey, the changes look pretty manageable”, so I took a stab at it and integrated HFCD with it.

You can now download HFCD 4 by following this link:

http://stopcoding.org/hfcd/4/download

HFCD 3 is now here:

http://stopcoding.org/hfcd/3/download

I strongly encourage you to use the installer (Mac only) because it takes care of downloading, installing, copying and configuring HFCD server, client and plugin for you. Windows folks, sorry, I’m working on the windows installer. I hope to get it out asap. BTW, the manual installation is not that bad, as long as you know how to use ant and install a plugin in Eclipse :-) .

Comments (7)

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

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.

Leave a Comment

HFCD Installer for Leopard Now Available! Windows Installer Coming…

Hello,

I admit that I don’t like the fact that there are way too many steps in the installation and configuration of HFCD. So, earlier this week, I decided to write an installer.

At first, I wanted to use one of those commercial installer software. But after checking out the prices (they’re insanely expensive), I decided to use PackageMaker for the Mac installer. PackageMaker is not the best… far from it, but it’s good enough for this project. It was also fun to do some Cocoa/Objective-C programming.

Basically, the installer takes care of the following:

  1. install the server SDK
  2. install the client SDK
  3. install the plugin for Flex Builder
  4. add the client SDK to the list of Installed SDKs

In other words, there is nothing for you to configure after running the installer!

Of course, if you want to run HFCD on a second machine, you need to copy over the server SDK directory and change the IP address in Flex Builder. The installation directory is /Users/username/Applications/HellFire Compiler 3. Please make sure that your /Users/username/Applications has the right permission (i.e. you can write to that directory).

The installer name is HellFire_Compiler_3.dmg. You can download it by visiting http://stopcoding.org/hellfire/download.

Comments (2)

HFCD Upgraded to Support Flex 3.4.1

Flash Builder Beta 2 is out! Finally I can test it with HFCD…

I downloaded and installed it earlier today. The good news is, HFCD works fine with Flash Builder Beta 2! Since Beta 2 ships with Flex 3.4.1, I’ve upgraded HFCD to support 3.4.1.10084. You can go to http://stopcoding.org/hellfire/download to get the latest HFCD binary.

Just to make it clear here, HFCD does not yet support Flex 4.0.0. I’m still evaluating the 4.0 compiler changes.

Leave a Comment

Using Flex (Flash) Builder with HFCD

UPDATE: Please also check out this post (http://stopcoding.wordpress.com/2009/10/22/how-to-setup-your-projects-for-hfcd) on how to setup your projects for HFCD.

Many thanks to those who downloaded and tested HFCD in the past couple of weeks. If you are a Flex Builder user and are not satisfied with its compiler performance, you should definitely give HFCD a try. I’m going to give some tips on using HFCD here.

Uploading source files from Flex Builder to HFCD

With this latest version of HFCD, you can run Flex Builder and HFCD on two different machines. So how does Flex Builder keep the source files on the HFCD side up-to-date? It is pretty simple. First, you make sure that both Flex Builder and HFCD are running and connected. Then simply close and reopen your projects. Typically you only need to do this once. There is no need to do this every time you start Flex Builder or HFCD. After the first upload, whenever you refresh (F5), add, edit or remove any source files in your projects, the HFCD plugin should pick up the changes and upload the changed files to HFCD.

Some Flex Builder users don’t always put the files needed by the compiler in the project directories. They put those files (e.g. SWC files and/or configuration files) *outside* of the Flex Builder workspace. Eclipse/Flex Builder does not know about these files, so they will not be automatically uploaded. To address this issue, one can use the “HFCD FileSet” view in the plugin.

hfcd3_img1

This “HFCD FileSet” view allows users to specify external directories. Users can then instruct the HFCD plugin to recursively search for and upload the files in these directories to HFCD.

hfcd3_img2

The above description also applies to the situation where Flex Builder and HFCD run on the same machine.

Building Flex applications and libraries with HFCD

Basically you use the same menu to clean and build Flex applications.

hfcd3_img3

The first clean/full build is usually slow because it’s the first and ‘warm-up’ build for HFCD. The performance of subsequent clean/full builds should gradually improve as HotSpot VM optimizations and parallel compiler builds kick in.

“Build Automatically” should be disabled when using HFCD. Why? Well, “Build Automatically” forces Flex Builder to immediately launch incremental compilations after code changes. But there is no need for that because HFCD automatically launches background incremental compilations. Other benefits? Flex Builder can’t let you save your code changes while it is building – you either save your code changes (and cancel the build) or keep the build going. With the use of HFCD, you can save your code changes continuously.

Comments (1)

Updating your HFCD Installation

I updated hfcd_3.zip this morning. The update fixed two issues:

  1. ‘clean builds’ did not clean cache files properly.
  2. distributed gc on the server side did not clear all the obsolete BuilderApplication objects.

Updating your HFCD installation is easy.

  1. Download hfcd_3.zip.
  2. Unzip your new hfcd_3.zip to a new directory.
  3. Copy all the files in the new directory to your existing HFCD installation.
  4. Run ‘ant patch’.

Comments (2)

How JVM Settings Affect the Flex Compiler Performance

Many of you who build medium to large-sized Flex projects with Flex Builder know that you need to modify the memory settings of the JVM in FlexBuilder.ini. For example, my JVM settings in FlexBuilder.ini look like this:

-Xms512m -Xmx1024m -XX:MaxPermSize=256m -XX:PermSize=64m

Other than having bigger -Xms and -Xmx values, it’s exactly the same as the default setting. The Flex Builder team did not arbitrarily set these values. They did not set the values for the compiler only. They set the values so that all the features in FB achieve optimal performance.

One of the arguments of using HFCD is that if you run the compiler out-of-process, you get a chance to configure the JVM for the compiler only. The HFCD installation only puts in the following default setting:

-Xms512m -Xmx1024m -XX:+UseParNewGC

I take the minimalist approach here because I want to give the HotSpot VM maximum flexibility to do its own tuning at runtime. So, does this HFCD out-of-process-compilation argument make sense? Well, let’s take a look at using Flex Builder to compile the Flex framework (a 800-file project).

Click here to read the rest of this entry.

Comments (1)

HFCD Installation and Configuration

As promised, I’m going to talk about how to install and configure the HellFire Compiler Daemon, a.k.a. HFCD. Again, if you’ve never heard of HFCD before, please check out the following posts:

  1. The Flex Compiler API… RPC Style
  2. A New Version of HFCD
  3. HFCD Beta Is Now Available

Before you download HFCD, make sure you meet the following system requirements:

  • Java 5 installed (Java 6 highly recommended). BTW, Flex Builder ships with JRE 5. It’s okay to use that, but the point of using HFCD is build Flex apps faster… and Java 6 is *faster* than Java 5…
  • Apache Ant installed. Mac OS X ships with Ant. If you use Windows, go download it at http://ant.apache.org.

Now, go to http://stopcoding.org/. Register and download hfcd_3.zip. The installation consists of 2 parts:

  1. Install the HFCD server and client SDK. In this step, you need hfcd_3.zip.
  2. Install the HFCD for Flex Builder plugin. In this step, you install the plugin via the Eclipse/Flex Builder Update Manager.

Click here to read the rest of this entry.

Comments (5)

Older Posts »