0

I have large project and it takes nearly 15 mins to compile through ANT. You can see I have already tried with parrallel with no success. Also experimented with localWorkers but didn't observe much difference. I am using i3 processor with 4 GB RAM. Please suggest all optimizing parameters for compiling this code quickly. But it has to be production quality :).

<target name="largeProject-gwtc"  depends="largeProject-compile" description="GWT compile to JavaScript">
    <!--parallel threadsperprocessor="1"-->
        <java failonerror="true" fork="true" classname="com.google.gwt.dev.Compiler">
            <classpath>
                <pathelement location="../common/src"/>
                <pathelement location="../largeProject/src"/>
                <pathelement location="build/largeProject/war/WEB-INF/classes"/>
                <fileset dir="build/largeProject/war/WEB-INF/lib" includes="*.jar"/>
                <pathelement location="${gwt.sdk}/gwt-user.jar"/>
                <fileset dir="${gwt.sdk}" includes="gwt-*.jar"/>
            </classpath>
            <!-- add jvmarg -Xss16M or similar if you see a StackOverflowError -->
            <jvmarg value="-Xmx2048M"/>
            <jvmarg value="-XX:MaxPermSize=1024m"/>
            <arg line="-war"/>
            <arg value="build/largeProject/war"/>
            <!-- Additional arguments like -style PRETTY or -logLevel DEBUG -->
            <arg line=""/>
            <arg value="com.test.web.largeProject"/>
        </java>
    <!--/parallel-->
</target>
YoK
  • 14,329
  • 4
  • 49
  • 67
  • 2
    Hey why down vote ? You need to post reason for down vote, that is what all stackoverflow user ethically follow. – YoK Sep 11 '11 at 08:19

2 Answers2

3

Not really. You can do some tricks for speeding up compiler but that applies mainly to development (not production ready state).

So nope, no magic is going to happen to save you. GWT compiler is slow and that's currently one of the biggest downsides of GWT.

Community
  • 1
  • 1
Xorty
  • 18,367
  • 27
  • 104
  • 155
0

On of the things you can try is using a 64bit JDK, at if possible version 7 of said JDK. I've tried this on existing projects which were previously compiled with 32 bit versions of either JDK 6 or 5, and just by switching to JDK 7 64bit I had some decent speed gains, sometimes up to 30-40%. Also, if possible, do this one a Windows machine, preferrably a Windows XP 64 bit, or second best a Window 7 64bit. With the risk of being flamed over by the people on this forum I'm gonna say this: from what I've tried so far, the JDK implementations are fastest on Windows, followed by Linux and finally the OS X JDK implementations are the slowest. This might just be true for the stuff I'm doing, but give it a shot why dontcha.

Shivan Dragon
  • 15,004
  • 9
  • 62
  • 103
  • I actually had performance boost compiling same GWT project (about 10%) using Debian 64bit over Win7 64bit. Both were running HotSpot 64bit on the same machine. – Xorty Sep 11 '11 at 11:17
  • Agreed, as I said, I only tried cross OS compiling time benchmarking for just some (a few) projects, and it those situations they went faster on win. I'm sure for others it will be faster on Linux/Debian. At any rate, it seems that switching grom 32 to 64 bit jvm helps performance. – Shivan Dragon Sep 11 '11 at 11:49
  • I use Win7 64 bit. Still I have problem with time it takes :(. – YoK Sep 12 '11 at 05:28