Flex Compiler Slower on 64bit Mode Java on Snow Leopard

Ever since I upgraded to Snow Leopard, the my flex apps seemed to compile slower. Today, I finally had enough and took a look into this problem. First, there was the weirdness with Java on Mac in that even though the compiler is a command line application(non-GUI), it creates a application menu. I cracked open the mxmlc script, and added:

-Djava.awt.headless=true

to VMARGS. This solved that issue, but didn't make it compile much faster.

Then, after a bit of fiddling around, it turned out that putting java into 32bit mode:

-d32

fixed the problem! The difference was significant. I tested this in 2 different apps. For App 1, it took 45 seconds to compile on 64bit mode, only 9 seconds on 32bit mode. For App 2, it took 30 seconds on 64bit mode, only 7 seconds on 32bit mode. So, mxmlc performs 4-5 times slower on 64bit java than 32bit, java. Why would this be the case, I have no idea. If anyone has an idea, I'd love to be enlightened. If you come across this problem, the fix is to open up mxmlc, and edit the line that says:

VMARGS="-Xmx1024m -Dsun.io.useCanonCaches=false"

and change it to:

VMARGS="-Xmx1024m -Dsun.io.useCanonCaches=false -Djava.awt.headless=true -d32"

I hope that helps someone.

blog comments powered by Disqus