IDEA-26866
Stop using FCSH
Please stop using the Flex Compiler Shell. Compilation speed could be increased a lot when using a different technique. Let me explain this in a little bit more detail. Say, we have modules A, B, C and D.
A depends on C
B depends on C
C depends on D
So this means we have a possible topsort of {D, C, B, A} but we can also have a two-dimensional sort like D}, {C}, {B, A. In that case we know which modules can be compiled in parallel. So we can compile D, then C, and then A and B in parallel. Basically the number of compiler processes should be limited of course since those "parallel projects" can grow large and you can have 50 of them.
Now that we can compile projects in parallel it would be an ideal option to stop using FCSH and spawn only a process of compc or mxmlc for each individual module. The cool thing is that FCSH is absolutely not needed when using the "-incremental" flag which will store a *.cache file for each compilation target next to the output file.
Why is this a better approach? If you have a really big project with 100+ modules the FCSH will run out of memory every time which makes compiling the project in our case a very long process. First FCSH will grow to some ridicolous amount of memory like 1GB and then crash, grow again to 1GB and crash ... The problem is that FCSH becomes slower the more memory it consumes. The time is ridicolous. It takes at the moment approx 10min to compile the whole project. With a simple application making use of this technique it takes about 1 minute – and it scales very well with the amount of cores.
Best,
Joa
In IDEA EAP 94.273 this functionality is hidden. To enable it you need to pass -Didea.flex.parallel.compilations.max=N option to IDEA's JVM. I suppose that reasonable values for N are ~ 4 - 8.
Add this option to bin\idea.exe.vmoptions file (Windows) or bin/idea.vmoptions file (other OS).
(Mac 10.6.2, Intellij 94.273)
The reason of recompilation is written in the Messages tool window. Please attach the whole its content if you suspect that recompilation is made even without changes.
What I'm wondering about is how this fits in when using a maven flex compiler with flexmojos. Is this supported too? Then I suppose modifying idea.properties or Java's VMOptions won't do much. I think we'd have to add idea's option for parallel compilation to the Flex Compiler Shell VM Parameters in the Project Structure's SDK?
This works in case of Flexmojos as well. You should not do anything with Flex SDK or Flex Compiler Shell VM Parameters