Site Search

2009-03-28

How to speed up the GWT compiler (reduce compilation time)

If you want to boost you GWT compilation performance by reducing the GWT compilation time significantly, you have to modify your Module.gwt.xml. You can speed up the compilation by reducing the number of supported browsers or/and by reducing the number of supported locales (if you are using I18N at all).

<module>

    <inherits name='com.google.gwt.user.User' />
<!--    There are five user agents: ie6, gecko (Mozilla), gecko1_8 (Firefox), safari, and opera.-->
<!--    To specify multiple user agents, you have to set multiple properties -->
<!--    and user.agent values like "ie6,gecko1_8,safari" are invalid.-->
    <set-property name='user.agent' value='gecko1_8' />

<!-- BEGIN: omit this part if you are not using I18N -->
    <inherits name='com.google.gwt.i18n.I18N' />
<!--    To specify additional locales if you are using I18N, -->
<!--    you have to add each single locale you want being supported. -->
<!--    The default locale (en_US) is always set.-->
    <extend-property name='locale' values='ru_RU'/>
<!-- END: omit this part if you are not using I18N -->

    <!--<inherits name="com.google.gwt.user.theme.chrome.Chrome"/>-->
    <!--<inherits name="com.google.gwt.user.theme.dark.Dark"/>-->
    <inherits name="com.google.gwt.user.theme.standard.Standard"/>
    <!-- Specify the app entry point class.                   -->
    <entry-point class='myModule.client.Module'/>
</module>

You should remember that these settings apply only for deployment compilation. You will not experience any performance advantages during your work within the GWT development browser. However the final deployment compilation should consume not more than 33% of the time!