0

Starting a recent project, my build time was significantly longer than others: 5.5 minutes vs. 1.3 minutes. The difference turned out to be that I was using Flash Builder (4.5) as an Eclipse (Helios SR2/3.6.2) plugin instead of using the standalone Flash Builder app.

Why is there such a difference? Is there a way I can get the Eclipse/plugin version to build equally quickly?

I have related Java projects as well, and I'd prefer to work on everything in one instance of Eclipse instead of having another version of Eclipse just for Flex. Apart from wasting RAM, I hate changing a setting only to find that I have to set it again in the other Eclipse instance.

Update:

For concerns that this might be different configurations (mere jarfile version differences are omitted):

Differences between /Applications/Adobe Flash Builder 4.5/Adobe Flash Builder 4.5.app/Contents/MacOS/Adobe Flash Builder 4.5.ini and /Applications/eclipse/Eclipse.app/Contents/MacOS/eclipse.ini:

< -XX:MaxPermSize=256m
< -XX:PermSize=64m
< -Declipse.product=com.adobe.flexbuilder.standalone.producte36
< -Declipse.application=com.adobe.flexbuilder.standalone.FlashBuilderApplication

> --launcher.XXMaxPermSize
> 256m
> -product
> org.eclipse.epp.package.java.product
> -XstartOnFirstThread
> -Dorg.eclipse.swt.internal.carbon.smallFonts
> -Dosgi.requiredJavaVersion=1.6
> -XX:PermSize=128m
> -XX:MaxPermSize=384m
> -XX:CompileThreshold=5
> -XX:MaxGCPauseMillis=10
> -XX:MaxHeapFreeRatio=70

Nothing that looks (to me) like it would make Eclipse slower, but I might not know what to look for.

blahdiblah
  • 33,069
  • 21
  • 98
  • 152
  • There are so many things that could be different it is hard to tell. Flash Builder is still just Eclipse. Have you compared config files between your two respective versions of eclipse? – JeffryHouser Jan 23 '12 at 19:43
  • I looked at all the settings for Eclipse/Flash Builder and the project itself that I could imagine were relevant and didn't find any differences. I'm seeing this with essentially 'stock' Eclipse and FB, no tweaked build settings certainly. – blahdiblah Jan 23 '12 at 19:47
  • I should have been more clear. the settings I recommend checking are the ones in the eclipse.ini/FlashBuilder.ini file. Look at the memory arguments sent to the Java JVM. I thought by default, Flash Builder sets values, but Eclipse does not. – JeffryHouser Jan 23 '12 at 20:23
  • Both have memory options set, but they look comparable (Eclipse has a slightly larger `-XX:MaxPermSize`). I'll post a cleaned up diff. Would JVM settings affect Flex compile time? – blahdiblah Jan 23 '12 at 20:47
  • 1
    "Would JVM settings affect Flex compile time?" Yes! – JeffryHouser Jan 23 '12 at 20:49
  • @www.Flextras.com Please include an answer to this effect for acceptance. – blahdiblah Jan 23 '12 at 21:41

2 Answers2

3

One reason a plugin version may work differently than the stand alone version is due to the memory settings set to the JVM used by Eclipse.

To compare the two, you should look at the FlashBuilder.ini file in the root directory of your Flash Builder stand alone install and compare it with the eclipse.ini file in the root directory of your eclipse install.

The arguments that relate to JVM memory settings are Xms, Xmx, XX:MaxPermSite, and XX:PermSize.

These are the settings from my own FlashBuilder.ini file:

-Xms768m
-Xmx1024m
-XX:MaxPermSize=256m
-XX:PermSize=64m

It is worth nothing that starting with Flash Builder 4.6; an eclipse.ini file exists in the eclipse subfolder of your Flash Builder installation directory. I'm pretty sure this file is ignored by Flash Builder.

JeffryHouser
  • 39,401
  • 4
  • 38
  • 59
  • 2
    In this specific case the offending setting was `-XX:CompileThreshold=5` that I picked up from [this SO answer](http://stackoverflow.com/a/3275659/85950). Removing that made Eclipse build just as fast as Flash Builder. Caveat Emptor. – blahdiblah Jan 23 '12 at 22:43
1

I have improved significantly my flash performance by following this steps http://www.redcodelabs.com/2012/03/eclipse-speed-up-flashbuilder/

Especially by setting the FlashBuilder.ini to the following configuration

-vm
C:/jdk1.6.0_25/bin
-startup
plugins/org.eclipse.equinox.launcher_1.2.0.v20110502.jar
–launcher.library
plugins/org.eclipse.equinox.launcher.win32.win32.x86_64_1.1.100.v20110502
-product
org.eclipse.epp.package.jee.product
–launcher.defaultAction
openFile
–launcher.XXMaxPermSize
256M
-showsplash
org.eclipse.platform
–launcher.XXMaxPermSize
256m
–launcher.defaultAction
openFile
-vmargs
-server
-Dosgi.requiredJavaVersion=1.5
-Xmn128m
-Xms1024m
-Xmx1024m
-Xss2m
-XX:PermSize=128m
-XX:MaxPermSize=128m
-XX:+UseParallelGC

My hardware configuration is intel i3 cpu, 4gb DDR3, windows 7 64Bit.

Adrian Pirvulescu
  • 4,308
  • 3
  • 30
  • 47