Category Archives: GWT

Optimize GWT performance

It depends on what you are looking to optimize. This article will give some advice concerning – compile time, initial download, and runtime performance.

If compilation takes too much time, you could have different configurations, one for continuous build, one for nightly / automated testing and another for production.
Here’s a link with more details on how to customize the GWT Compiler.

If the initial download of the application is too large, you can check if you are using Code Splitting, a feature that allows the application GWT to start  running after it downloaded a part of the code, while other parts of the code will be downloaded as they are needed. More details here. You can see quickly if it is used or not in the compile report.

If the application is slow at runtime (if it takes long between when you press a button and the action happens), maybe there are too many elements in the DOM. For example if you have a tab panel with complicated UI in each tab, if a tab is not selected, you can remove it from the DOM, and the rest of the application will run faster. (Save it’s index to insert it back in the same place when you need it).

protected void detach (Widget child) {
child.getElement (). removeFromParent ();

protected void attach (Widget child, int beforeIndex) {
getElement (). insertChild (child.getElement (), beforeIndex);

Depending on what libraries you use, they can also slow your app down. Standard GWT is pretty fast, libraries (like GXT that I use also :D) will definitely slow down your app.
Of course it depends on which libraries, and how well they are written. For example mGWT will not make your app slower :).

GWT has several options to optimize the compiler (by modifying the  gwt.xml file), for example:

<! – Smaller JS file ->
<set-property name=”compiler.stackMode” value=”strip” />
<set-configuration-property name=”CssResource.obfuscationPrefix” value=”empty” />

Also make sure the production build does not have this tag in gwt.xml:

<inherits name=””/>

because it will run slower. 😀

There are definitely other optimizations. Add a comment if you have anything to add here :).


This post will explain the cause of this exception and provide an easy fix – with no need to add extra jars to your classpath or manually manipulate your jars.

I first saw this exception when I upgraded a project from GWT 2.4 to GWT 2.5.

The project also uses GXT 2 and 3 running side by side.

After the upgrade I saw this in the logs:


Caused by: java.lang.NoClassDefFoundError: com/google/gwt/core/client/GWTBridge
at com.extjs.gxt.ui.client.core.FastMap.<init>(

Continue reading