Archive for June, 2008

Configuring Flex Builder to use the HellFire compiler

Attention: The installation instruction is no longer valid. Please go to http://stopcoding.org/ to download the latest version of HFCD.

Hi, In my previous post, I talked about a RPC version of the Flex compiler API, i.e. instead of invoking the Flex compiler in the same JVM process as the caller, the RPC version makes network calls to a server dedicated to compiling Flex applications, modules and libraries. After working on the prototype a little more in the past several weeks, I finally have something for you to try – I call it the HellFire Compiler (yes, I give my work a name because ‘a RPC version of the Flex compiler’ is a mouthful).

There are three pieces in the HellFire Compiler:

  1. A special version of flex-compiler-oem.jar. It is simply an implementation of the Flex Compiler API that makes network calls to a compiler daemon.
  2. hfcd (HellFire Compiler Daemon). Users run hfcd as an independent, separate process (as a background job or in a Terminal window). hfcd uses the original flex-compiler-oem.jar to compile Flex applications.
  3. An Eclipse/FB plugin. This is usually installed in FB. It retrieves from hfcd information about the compilations, e.g. compile time, link time, memory usage, etc.

Installation

So how do you go about configuring Flex Builder 3 to use the HellFire Compiler? First, we take care of hfcd…

  1. Download and unzip hfcd_3.0.0.477.zip.
  2. Download flex_sdk_3.0.0.477.zip and (do not unzip) and put it in the hfcd_3.0.0.477 directory.
  3. Run ‘ant’ in the hfcd_3.0.0.477 directory.
  4. You can now run hfcd in server/bin.

Please check out the screenshot below. It shows the expected results after step 3 and 4.

Now, we configure FB3 to use the RPC version of flex-compiler-oem.jar.

1. Run ‘Adobe Flex Builder 3′. Click ‘Preferences –> Flex –> Installed Flex SDKs’.

2. Click ‘Add’.

3. Click ‘Browse…’ and select ‘client’ in the hfcd_3.0.0.477 directory.

4. You should see ‘HellFire Compiler’ as the Flex SDK name. Click ‘OK’.

5. Select ‘HellFire Compiler’ as the default SDK. You can choose not to do this. But each Flex project must be individually configured to use the ‘HellFire Compiler’ sdk.

6. Click ‘OK’. Flex Builder 3 now uses the HellFire compiler to compile your opened projects. You should make sure hfcd is running before clicking ‘OK’.

Now, let’s install the Eclipse/FB plugin.

1. Click ‘Help –> Software Updates –> Find and Install…’.

2. Click ‘Search for new features to install’.

3. Click ‘New Local Site…’ and select ’site’ in the hfcd_3.0.0.477 directory.

4. The local site name is ‘hfcd_3.0.0.477/site’. You may change it to whatever you want.

5. Click ‘Finish’. Eclipse now reads site.xml in order to find out what are available.

6. Select ‘HellFire Compiler 3.0.0.477′ and click ‘Next’.

7. Read and accept the license agreement.

8. You may change the installation directory. I would not. Click ‘Finish’.

9. The plugin is not digitally signed, but it’s okay. Click ‘Install All’.

10. Click ‘Yes’ when you are asked to restart Flex Builder.

11. You should now see the ‘HellFire Compiler’ view in FB.

12. Click ‘Project –> Clean’ and start a build immediately. You will see in the ‘HellFire Compiler’ view what hfcd has compiled and the applications/libraries compile/link time.

The software will expire on August 1st, 2008. But I’ll likely have an update available before the expiration.

Note that this software has not reached production quality yet. If you see any issues, please email hfcd@stopcoding.org

Uninstallation

1. Run ‘Adobe Flex Builder 3′. Click ‘Preferences –> Flex –> Installed Flex SDKs’.

2. Select ‘HellFire Compiler’. Click ‘remove’ and ‘OK’.

3. Click ‘Help –> Software Updates –> Manage Configuration’.

4. Right-click ‘HellFire Compiler’. Select ‘Uninstall’. Restart Flex Builder.

What’s next?

There are several areas I would like to explore

  • With hfcd, the compiler and the other FB features are separated and it’s possible to give the VM for hfcd specific VM args that boost the performance of the compiler. For example, I’ve seen consistent 30% performance improvement when hfcd uses the ‘-server’ VM mode. It may be true or maybe I forgot to blink my eyes. I don’t know. Also, it’s interesting to see how aggressive the VM grows the heap in ‘-server’ VM mode.
  • Running hfcd on a second machine. When I was with Adobe, there was a desktop under my desk (I don’t know why I put a *desktop* computer *under* my desk) that I occasionally used for testing purposes. It was faster than my laptop too! So in theory, if you run hfcd on such a machine, it could shorten the FB build time…. I’m going to see if Eclipse can help me synchronize files and remap paths….
  • Suppose that there are two independent projects in your workspace, i.e. no project references. In theory, Eclipse/FB could compile the projects in parallel. If so, it would make the out-of-process solution even more compelling.
  • The Eclipse/FB plugin currently only retrieves compile time and link time. But there is nothing to prevent the plugin from retrieving compiler reports (e.g. dependency info, usage info), bytecode disassembler output, etc.

Comments (30)