Filed Under (ActionScript, Flex, General, RIA) by jonr on June-26-2008

I have finally gotten the chance to immerse myself in Flex code lately. I decided to do this series to capture my first hand experiences with Flex. Please share your feedback on the challenges and strengths I highlight. I would love to know if your experiences differ, or if you can fill in some of the gaps where I might be missing something. For those of you considering Adobe Flex, hopefully this will give you an accurate picture of building applications with Flex.

The compiler is currently my number one frustration with Flex development – it is quite SLOWWWWWWW…… To the point where I have been wondering if we are doing something wrong. I have done dozens of Google searches and only found mild relief.

In general, all compile operations seem quite slow. Our near deal breaking issue is around a SWC library we are building. Here are a few numbers to help quantify what we are seeing:

  • 31 MXML source files
  • 24 ActionScript source files
  • 3 embedded images
  • Building typically ranges from: 25-35 Seconds (On ThinkPad T60, Ubuntu, FlexBuilder 3, 2 GB RAM, Core Duo T5600)

We do have a couple of embedded resources, but I don’t see many options here since we do need these as part of our API. We also have the incremental and keep flags set:

-incremental=true –keep=true

It is nice to see Flash Player 10 beta is out with its performance improvements, but I don’t see much talk about addressing the MXMLC compiler performance. Are there plans to address this, or is there a workaround we are missing?

Click here to subscribe to my RSS feed and follow the rest of this series along.

Share and Enjoy: These icons link to social bookmarking sites where readers can share and discover new web pages.
  • DZone
  • Digg
  • del.icio.us
  • Reddit
  • Facebook
  • LinkedIn

Comments:
Jon Rose’s Blog » Blog Archive » Life with Flex on June 26th, 2008 at 12:36 am #

[...] Life with Flex: Compiler (Thursday – 6/26) [...]

VELO on June 26th, 2008 at 6:24 am #

Hi Jon,

Flex compiler is quite slow. One alternative is use HFCD (http://stopcoding.wordpress.com/2008/06/17/hellfire_compiler/)

It will load flex compiler on memory, into a daemon and will keep it loaded. So you will not reload it over and over again.

Still slow, faster, but slow.

On modular applications (don’t looks be your case) you can get all files compiled faster using flex-mojos, it starts flex-compiler only once to compile all modules.

On single applications, you can try to use HFCD + flex-mojos. I didn’t made performance tests so far, but works http://blog.flex-mojos.info/2008/06/20/using-hellfire-compiler-under-flex-mojos/

VELO

Bartek on June 26th, 2008 at 6:54 am #

Jon,
Even though the incremental compilation is turned on by default I guess much of the time is spent in producing the resulting SWF. Have you tried to divide your project using modules or library projects?

By the way – great blog :)
Looking forward for the rest of the series.

jonr on June 26th, 2008 at 8:53 am #

Will HFCD make difference inside of Flex Builder? It sounds like it loads the SDK / Compiler into memory too: http://www.adobeforums.com/webx/.59b4c61c.

Tom Chiverton on June 27th, 2008 at 4:14 am #

You could also look at the Flex Compiler Shell (fcsh). I’m betting most of your 25 seconds is spent starting up the JVM, and fcsh keeps it around between invokes.
You don’t say if this is Flex 2 or 3, but 3 is a lot quicker than 2 was – if you are on 2 and can upgrade.

Kelvin Luck on June 27th, 2008 at 5:51 am #

Are you currently just using mxmlc? If so you should use fsch:

http://labs.adobe.com/wiki/index.php/Flex_Compiler_Shell

This is what flex builder (and FDT and flash develop) use internally and it doesn’t have the overhead of starting a Java enviroment for each compile… I think it’s already included in the Flex 3 SDK… It can be tricky to access from ant because it requires leaving the process running but this may help:

http://fcshwrapper.blogspot.com/

Cheers :)

VELO on June 27th, 2008 at 6:49 am #

At present time I don’t believe HFCD will bring any great result (may be if you give he move memory you can get better results, since compiler doesn’t share memory with eclipse any more.)

HFCD will show great results when you can run it on dedicated machines. Like compilation farms. But so far HFCD doesn’t support that.

VELO

jonr on June 27th, 2008 at 11:03 am #

We are using Flex 3 – inside of the latest Flex Builder…

Clement Wong on July 4th, 2008 at 5:59 pm #

-keep=true instructs the compiler to write the auto-generated text to your file system. I would use -keep=false to avoid the unnecessary file i/o.

you only use -keep=true when you suspect that the Flex compiler doesn’t generate correct code for your MXML components.

Also, Flex Builder uses incremental compilation by default. There is no need to set -incremental=true.

I think by removing the entire “-incremental=true -keep=true’, you get an acceptable compile time.

-C

jonr on July 5th, 2008 at 5:20 pm #

So, if incremental defaults to true and keep to false then the settings you recommend are the defaults, correct? These were pretty slow for me. I only start playing trying different setting because of the poor compile times with the default configuration.

[...] Life with Flex: Compiler [...]

[...] Life with Flex: Compiler [...]

Post a comment
Name: 
Email: 
URL: 
Comments: