Any advice for speeding up the compile time in Flex Builder 3?

12,501

Solution 1

In addition to the suggestions already mentioned, close any projects that you have open that you are not using.

Rich click on the Project in the Navigator view and select "Close Unrelated Projects".

Depending on how many projects you have open, this can lead to a significant improvements in compile time, as well as all around performance.

mike chambers

[email protected]

Solution 2

First of all, comments on some of the response:

  1. There is no need to explicitly specify -incremental in Flex Builder because it uses incremental compilation by default.

  2. -keep-generated-actionscript is a performance killer because it instructs the compiler to write out AS3 codes generated for MXML components in the middle of the compilation. File I/O in the middle of a compilation means unnecessary pauses and low CPU utilizations.

  3. -optimize slows down linking because it instructs the linker to produce smaller SWFs. Note that -optimize=true|false doesn't have any effect on building SWCs because SWCs are libraries and have to be unoptimized.

  4. I rarely mess with JVM settings because JVM knows its jobs well and tunes itself quite well at runtime. Most people make matter worse by setting various GC tuning parameters. That said, there are 3 settings most people understand and set correctly for their usage:

-Xmx (max heap size)

-server or -client (HotSpot Server or Client VM)

-XX:+UseSerialGC or -XX:+UseParallelGC (or other non-serial GC)

-server consistently outperforms -client by about 30% when running the Flex compiler. -XX:+UseParallelGC turns on the parallel garbage collector. ideal for multicore computer and when the computer still has CPU cycles to spare.

You may also want to check out HellFire Compiler Daemon (http://bytecode-workshop.com/). It uses multiple processor cores to compile multiple Flex applications at the same time. You can also run the compiler on a second machine via sockets (assuming that your second machine has faster CPUs and more memory).

In my opinion, use more modules than libraries and use HFCD.

Hope this helps.

-Clement

Solution 3

There's no need to use mxmlc on the command line just to be able to add compiler flags. Right click your project in the Flex Navigator, select Properties and then Flex Compiler in the dialog that appears. There you can add any extra compiler flags.

Not sure that there's very much to do though, more code means more compile time, that's just the way it is. If you're not doing a release build (or whatever it's called in Flex Builder) it's unlikely that your compiler settings include optimize to begin with. Better choices to try would be -incremental (which only recompiles the parts that have changed) and -keep-generated-actionscript (which stops the compiler from deleting the ActionScript files it has generated from your application's MXML files).

I very much prefer using mxmlc on the command line (by way of Ant) compared to Flex Builder. Although I don't think that the latter compiles any slower, it feels more sluggish in every way. Using Ant also makes it possible to do more than just compilation when building, and conditional compilation (only compile a SWF or SWC if the source code has actually changed). Check out a blog post of mine for more info on that.

What you could try is the Flex Compiler Shell, another command line tool that can speed things up. Basically it tries to keep as much as possible in memory between builds, so no need to wait for things like the JVM starting up (the Flex compiler is a Java application). On the other hand this is sort of what Flex Builder does anyway.

Solution 4

I created RAM Disk with workspace and it gives up to 10% of better compilation time. Not much, but something.

Solution 5

Slow compile time is most often caused by having large numbers of embedded resources ([Embed] or @Embed).

Option 2 on this article might help you: [http://www.rogue-development.com/blog2/2007/11/slow-flex-builder-compile-and-refresh-solution-modules/]

Share:
12,501
Paul Mignard
Author by

Paul Mignard

You can see it all at my site - but i wouldn't go there.

Updated on June 12, 2022

Comments

  • Paul Mignard
    Paul Mignard about 2 years

    I run Flex Builder 3 on a mac and as my project grows - the compile time gets longer and longer and longer. I am using some SWC's and there is a fair amount of code but it shouldn't take minutes to build and crash daily should it?

  • Cherry
    Cherry over 15 years
    Sadly, even on my 8 core Mac Pro w/ 12 GB of RAM, Flex builds take forever for a small piece of code. I waste a lot of time waiting for Flex to build. mxmlc on my dual core Xeon Linux box isn't much if any faster. "Close unrelated projects" doesn't matter for me; I only have one project open.
  • Juan Delgado
    Juan Delgado over 15 years
    Sorry, just realized that Theo linked to it : |
  • The D Williams
    The D Williams about 14 years
    We have a really big Flash Builder 4 project, and compile time is still a problem even on the fastest machines. The problem is that the smallest change, even to the internals of a private function, seems to cause Flash Builder/Flex to rebuild the world, completely unnecessarily. Perhaps they plan class caching etc for a future release!
  • surfer01
    surfer01 over 13 years
    I don't understand your point on -keep-generated-actionscript. Are you saying the I/O cost of caching these resources outweighs the cost of recompiling them EVERY SINGLE BUILD? I find that unbelievable, given that I build my code dozens of times every day.