title: PHP: exec Yuicompressor.jar so slow
body: <p>It's pretty easy to <strong>minimize</strong> scriptS with <a href="http://developer.yahoo.com/yui/compressor/" rel="nofollow">Yuicompressor</a>. Unfortunately, this process is totally slow when executing the JAR with <code>exec</code> in php.</p>
  
  <p><em>Example (PHP):</em></p>
  
  <pre><code>    // start with basic command
      $cmd = 'java -Xmx32m -jar /bin/yuicompressor-2.4.8pre.jar -o \'/var/www/myscript.min.js\' \'/var/www/myscript.min.temp.js\'';
  
      // execute the command
      exec($cmd . ' 2&gt;&amp;1', $ok);
  </code></pre>
  
  <p>The execution time for ~20 files takes up to 30 seconds ! on a Quad Core Server with 8GB Ram.</p>
  
  <p><strong>Does anybody know a faster solution, to minimize a bunch of scripts ?</strong></p>