title: How can I speed up MXMLC compiles?
body: <p>I am using ant to build my web application. I have a target in my ant script which takes approximately 8 minutes to compile. Since <code>mxmlc</code> compiles everything from scratch and loads up the JVM each time, it is taking a lot of time. Is there a way to optimize this task?</p>
  
  <p>I am using Flex SDK 3.0.  Here is my ant target:</p>
  
  <pre><code>&lt;target name="compile.organic.flash" depends="setup"&gt;
    &lt;property name="WelcomeBack.swf" value="${www.dir}/swf/as3/apps/welcome/WelcomeBack.swf" /&gt;
    &lt;mxmlc file="${AS3.classpath}/com/organic/app/fthb/welcome/src/WelcomeBack.as"
           output="${WelcomeBack.swf}"
           incremental="${mxmlc.inc}"
           default-frame-rate="30"
           accessible="true"
           default-background-color="${swf.backgrond.color}"
           allow-source-path-overlap="true"
           compiler.strict="true"&gt;
      &lt;default-size width="940" height="528" /&gt;
      &lt;source-path path-element="${Welcome.path}"/&gt;
      &lt;source-path path-element="${AS3.classpath}"/&gt;
    &lt;/mxmlc&gt;
  
    &lt;property name="Welcome.swf" value="${www.dir}/swf/as3/apps/welcome/Welcome.swf" /&gt;
    &lt;mxmlc file="${AS3.classpath}/com/organic/app/fthb/welcome/src/Welcome.as"
           output="${Welcome.swf}"
           incremental="${mxmlc.inc}"
           default-frame-rate="30"
           accessible="true"
           default-background-color="${swf.backgrond.color}"
           allow-source-path-overlap="true"
           compiler.strict="true"&gt;
      &lt;default-size width="940" height="528" /&gt;
      &lt;source-path path-element="${Welcome.path}"/&gt;
      &lt;source-path path-element="${AS3.classpath}"/&gt;
      &lt;compiler.include-libraries dir="${AS3.component}/" &gt;
      &lt;/compiler.include-libraries&gt;
    &lt;/mxmlc&gt;
  
    &lt;property name="App.swf" value="${www.dir}/swf/as3/apps/App-${svnVersion}.swf" /&gt;
    &lt;mxmlc file="${AS3.classpath}/com/organic/app/fthb/App.as"
           output="${App.swf}"
           incremental="${mxmlc.inc}"
           default-frame-rate="30"
           default-background-color="${swf.backgrond.color}"
           compiler.strict="true"&gt;
      &lt;default-size width="300" height="300" /&gt;
      &lt;source-path path-element="${AS3.classpath}"/&gt;
      &lt;compiler.include-libraries dir="${AS3.component}/" &gt;
      &lt;/compiler.include-libraries&gt;
    &lt;/mxmlc&gt;
  
    &lt;property name="LSOApp.swf" value="${www.dir}/swf/as3/apps/LSOApp-${svnVersion}.swf" /&gt;
    &lt;mxmlc file="${AS3.classpath}/com/organic/boa/fthb/LSOApp.as"
           output="${LSOApp.swf}"
           incremental="${mxmlc.inc}"
           default-frame-rate="30"
           default-background-color="${swf.backgrond.color}"
           compiler.strict="true"&gt;
      &lt;default-size width="300" height="300" /&gt;
      &lt;source-path path-element="${AS3.classpath}"/&gt;
      &lt;compiler.include-libraries dir="${AS3.component}/" &gt;
      &lt;/compiler.include-libraries&gt;
    &lt;/mxmlc&gt;
  
    &lt;property name="CheckRates.swf" value="${www.dir}/swf/as3/apps/CheckRates-${svnVersion}.swf" /&gt;
    &lt;mxmlc file="${CheckRates.path}/CheckRates.as"
           output="${CheckRates.swf}"
           incremental="${mxmlc.inc}"
           default-frame-rate="40"
           accessible="true"
           default-background-color="${swf.backgrond.color}"
           compiler.strict="true" compiler.allow-source-path-overlap="true" &gt;
      &lt;default-size width="940" height="528" /&gt;
      &lt;compiler.source-path path-element="${AS3.classpath}"/&gt;
      &lt;compiler.source-path path-element="${CheckRates.path}"/&gt;
      &lt;!--  &lt;source-path path-element="${AS3.classpath}"/&gt; --&gt;
      &lt;compiler.include-libraries dir="${AS3.classpath}"&gt;
      &lt;include name="fl/fl.swc" /&gt;
      &lt;/compiler.include-libraries&gt;
    &lt;/mxmlc&gt;
  
    &lt;copy file="${AS3.classpath}/com/organic/app/fthb/checkRates/js/config/check_rates_config.js" tofile="${www.dir}/swf/as3/apps/config/check_rates_config.js"/&gt;
    &lt;property name="PointsCalculator.swf" value="${www.dir}/swf/as3/apps/PointsCalculator-${svnVersion}.swf" /&gt;
    &lt;property name="flash.apps.build.dir" value="${www.dir}/swf/as3/apps" /&gt;
    &lt;compile-flash basename="PointsCalculator" srcdir="${flash.apps.src.dir}/pointsCalculator"&gt;
    &lt;/compile-flash&gt;
    &lt;copy todir="${flash.apps.build.dir}/config"&gt;
      &lt;fileset dir="${flash.apps.src.dir}/pointsCalculator/config" includes="*.js"/&gt;
    &lt;/copy&gt;
    &lt;copy todir="${build.dir}/www/css"&gt;
      &lt;fileset dir="${flash.apps.src.dir}/pointsCalculator/css" includes="*.css"/&gt;
    &lt;/copy&gt;
    &lt;copy todir="${build.dir}/www/swf/as3/apps/welcome/assets/swfs"&gt;
      &lt;fileset dir="${flash.apps.src.dir}/welcome/assets/swfs" includes="*.swf"/&gt;
    &lt;/copy&gt;
    &lt;copy file="${videoplayer.dir}/videoplayer.swf" tofile="${www.dir}/swf/as3/apps/videoplayer.swf" /&gt;
  &lt;/target&gt;
  </code></pre>