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

14

12

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?

Suisse answered 29/8, 2008 at 1:34 Comment(0)
C
5

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]

Conferee answered 15/9, 2008 at 22:43 Comment(2)
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.Madsen
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!Antimagnetic
K
10

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

Karrikarrie answered 14/4, 2010 at 18:42 Comment(1)
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.Grower
R
8

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.

Rudelson answered 29/8, 2008 at 16:13 Comment(0)
C
5

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]

Conferee answered 15/9, 2008 at 22:43 Comment(2)
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.Madsen
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!Antimagnetic
A
4

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/]

Aldwon answered 29/8, 2008 at 11:14 Comment(0)
B
4

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

Baud answered 26/10, 2009 at 8:44 Comment(0)
O
2

You want at least 4 gigs on your computer if possible, and make sure to override the default memory settings that eclipse/flexbuilder gives to the application.

If you're not sure how to do this, you can find the flexbuilder app in /Applications, right click and choose "Show Package Contents". Then go into the contents file and edit the eclipse.ini file. Edit that file have memory settings of at least:

-vmargs -Xms768m -Xmx768m -XX:PermSize=128m -XX:MaxPermSize=128m 

It's also worthwhile to go into the eclipse/flexbuilder preferences and to check the "Show heap status" box under Windows->Preferences->General (This is in eclipse with the FB plugin, I'm assuming it's also there for standalone FB).

This shows the current memory in the lower right of the window and has a little trash icon so you can force garbage collection.

I'd also suggest turning off automatic building of the project when your files change (you can force a build with cmd-B).

We had a huge project with quite a few modules files and performance in FlexBuilder 3 was decent with these steps.

Observant answered 16/1, 2009 at 6:48 Comment(0)
A
1

Go to Project->Properties->Flex Applications. All of the applications listed are compiled each time (even though you have a default set). If you remove everything but the default (don't worry, it won't delete the actual files), it only compiles the default app. This resulted in a significant speed up for me. If you change your default app, it ADDs it to the Flex Applications list - adding to your compile time. You will need to maintain this list to get the quickest compile.

Abdullah answered 15/1, 2009 at 18:35 Comment(0)
L
1

I always disable "automatic compile" for Flex. It compiles too much, takes too long, and so interrupts my work.

If you have many different project files and all of those needs to be recompiled, but you also have other projects open and don't want to close them always you're doing a build, you can also use Eclipse Working Sets.

Unfortunately, the default Flex Navigator does not support working sets. But you can open the Package Explorer with Window / Show View / .... Click on the little white downward arrow to the topright and select Top Level Elements: Working Sets. You can then add Working Sets (aka groups of projects). Each project needs to be in at least one working set ("Other Projects" being the default), but can be in several.

Now with Project / Build Working Set / ... you can instruct Eclipse to build all the projects in this working set, but none of the others. This is especially useful if you suspect your project references to be sometimes broken - otherwise building the 'topmost' project should trigger subsequent builds automatically.

Lamori answered 3/11, 2009 at 23:29 Comment(0)
A
1

As Clement said, use the HellFire Compiler Daemon. If you have multiple modules and more CPU cores on your machine it can compile them in parallel. Another option is to use IntelliJ (the commercial version) which offers the same feature.

Acetum answered 15/8, 2010 at 9:4 Comment(0)
S
1

The SDK 4.x.x introduced silly bug (see Adobe bugsystem, issue FB-27440), which causes projects with SVN or CVS meta data compile much slower than with SDK 3.x.x. On how it can be fixed, see here.

Starch answered 17/12, 2010 at 16:5 Comment(0)
M
0

You may want to explore the command-line compiler found in the Flex SDK, mxmlc. As I recall, Flex Builder 3 seems to hide all the compiler details, but perhaps there are arguments you can append that will help you speed up the compilation.

For example, you may want to set optimize=false which will skip the step of optimizing the bytecode (perhaps reducing compilation time)? This of course comes at the price of performance and file size of the actual application.

More documentation on mxmlc can be found at: http://livedocs.adobe.com/flex/3/html/compilers_13.html.

Good luck!

Mickel answered 29/8, 2008 at 5:40 Comment(0)
J
0

I don't use Flex Builder, but I use the Flex SDK compiler everyday and I was wasting tons of time waiting for the MXMLC compiler to do its job until I found Flex Compiler SHell:

http://blog.zarate.tv/2008/12/07/theres-something-called-flex-compiler-shell/

Although in theory Flex Builder already uses this optimizations, might be worth checking.

Jugal answered 16/1, 2009 at 8:7 Comment(1)
Sorry, just realized that Theo linked to it : |Jugal
R
0

You can use WORKING SETS to compile just a set of your components that are part of the application that you are changing and not the whole project

http://livedocs.adobe.com/flex/3/html/help.html?content=build_6.html

Reprove answered 8/8, 2013 at 15:26 Comment(0)
F
-1

Usually the first build takes the longest, and then it's pretty quick after that. That's using Vista x64 w/ core 2 duo.

Otherwise, I am nearly certain a Intel Core i7 Extreme Edition 965 3.2GHz upgrade processor would speed your Flex building up nicely .. :) :) :)

Flesh answered 16/1, 2009 at 6:59 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.