Thursday, June 14, 2007

Flex compilation 15x faster with the flex compiler shell

When compiling flex applications with the command-line compiler mxmlc (or compc), compilation is slooooow. Mostly due to startup and warmup time, I think. But this startup has to be done at each compilation.

Then I came across the Flex Compiler Shell (fcsh). It is kind of like the old maven 1.0 console plugin. Fcsh starts an interactive shell, in which you can execute compilations. The first compilation is slow like before, but compilations afterwards are much faster. The compiler is loaded and warmed up. In addition, it only does incremental compilation.

As an example: When using the maven plugin as described in my post about building flex with maven, compiling our current flex application into a flash movie takes ~15 secs on my development box. When I run it inside a warmed up fcsh, it takes ~1 second. A 15x times speedup!

Adobe say fcsh is targeted to be included in the Flex3 release, but it is ready now, to be used with Flex2. You just have to download and install it yourself.


philmaker said...

Are you interesting in helping to develop fcsh integration /automation scripts? e.g. where you don't have to use an interactive shell to command fcsh. If so, please email me at philip at philmaker doot com

I've found a few leads but I'm not yet sure if they're very robust:

Tech Per said...

I might be able to contribute something, but I think it should be done in the context of something like maven and its plugins.

One idea could be to contact the folks behind the Israfil flex compile mojo. They have an open source google code project with a maven plugin. I am thinking in the lines of:

Extend the maven plugin to be able to start a fcsh-server with something like: mvn israfil:run-fcsh-server

Extend the maven plugin to be able to talk with the fcsh-server (if running) and compile through that.

philmaker said...

I'm written a wrapper server command for fcsh using Java i/o processes. It's nearly ready but the tools is having trouble determining when to close the connection - .e.g. determining when it's encountering a new fcsh prompt.

I'll likely post it soon at - in the meantime, send me an email at philip att philmaker dit com

philmaker said...

The fcshserver is not yet fini but close.