开发者

GWT compile to javascript takes lot of time

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="开发者_StackOverflow社区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>


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.


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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜