Speeding up Flex compile time with compiler-config.xml

Hi, I'm working with a straight Actionscript project just to get the feel for IDEA, but I'm finding compiles much slower than Flex Builder.  I wonder if this is because the .actionScriptProperties file in a Flex Builder Actionscript project excludes a bunch of libs using :

  <libraryPathEntry kind="4" path="">

    <excludedEntries>

      <libraryPathEntry kind="3" linkType="1" path="${PROJECT_FRAMEWORKS}/libs/automation_charts.swc" useDefaultLinkType="false"/>

      .. etc.

is it possible to do the same thing using the compiler-config.xml file, and if so, with what syntax?

Anyhow, perhaps I should just rephrase the question and ask "How can we make IDEA compile flex as fast as Flex Builder does"?  Or even half as fast would be good enough  ;)

Thanks!  

P

6 comments
Comment actions Permalink

Hi Peder,
I'm not sure that excluding some framework SWCs would shorten compilation significantly, though you can try. To do this you ned to uncheck 'Use default SDK compiler configuration file', check 'Use custom compiler configuration file', copy all required stuff  form standard flex-config.xml to custom config, with different library-path. Or probably you can keep both 'Use default SDK compiler configuration file' and 'Use custom compiler configuration file' checked and in custom config provide <library-path> section without append="true" attribute. It should override <library-path> from base config in this case.

Anyway, compilation should be fast even with extra SWCs in classpath. Make sure that you press 'Make Project' (Ctrl+F9). Build | Rebuild Project is usually longer.
IDEA doesn't compile modules that were not touched since previous compilation (and modules it depends on were not touched). If you see recompilation without changes this is probably a bug.

How many modules/facets do you have? How many source files in each? Any heavy resource files? What is usual compilation time?

0
Comment actions Permalink

Hi Alex,

Thanks for the quick reply. Let me give you some more details.   I just purchased IDEA because I do not want to pay $700 for Flash Builder.  So I started a project by going through the IDEA project wizard, and created a new Actionscript/Flex project.   That creates a basic single HelloWorld.as file.  That is all I'm doing.   I change the text in the text field a bit, just to force a new compile.  When I hit make, I see three messages at the bottom:

1. Make...  (Takes half a second)
2. Compiling HelloWorld....  (Small pinwheel is rotating next to it.  This takes about 1-2 seconds.)
3. Compile...  (Almost instant)

Hope that helps.   

0
Comment actions Permalink

I should add that I have another project that has a few classes, maybe 8 or 9, uses the Robotlegs framework and a few other swcs, and it takes 5 - 6 seconds to "compile".  But again, it seems like it's not the compile that takes time, but some time of pre-compile process that IDEA is doing.

0
Comment actions Permalink

For projects with small amount of modules 'fcsh' should be the fastest compiler (see File | Settings  Compiler | Flex Compiler). First compilation takes the same time, but next should be faster.

First compilation of sample AS project takes ~1 second in my environment, second and further - much less than 1 second.

0
Comment actions Permalink

Tried all three options, all of them take a long time.   Flex builder is lightning fast, so its' not my machine.  

Perhaps we should end this thread, because the only way I can see this issue being resolved would be for you to take over my desktop and have a look, and that would obviously be asking too much in the customer service department -- unless you felt that it would help you improve your Flex product development efforts.  ;)

0
Comment actions Permalink

We can find what takes extra time on you machine if you create and send us CPU snapshots as written here: http://devnet.jetbrains.net/docs/DOC-192. Start capturing, press 'Make' button and stop capturing when compilation finishes. Let it be the 2nd compilation (after small change) using fcsh and/or built-in compiler shell.

0

Please sign in to leave a comment.