Dienstag, 20. März 2012

Speed up compile time for GWT

Compilation takes long time for GWT projects. The reason for it is the permutation for different browsers.
Permutation means the GWT compiler generates JS and HTML files for different browser by default.
This can be really annoying when you are developing and you only want to see the result in the IE or Firefox

To enable permutation for only one browser do the the following:
Open file XXXXX.gwt.xml of your application.
add this line:
possible values are:
  • ie6 = Internet Explorer 6
  • ie8 = Internet Explorer 8
  • ie9 = Internet Explorer 9
  • gecko1_8 = Firefox
  • safari = safari and chrome
  • opera = opera
To enable permutation for 2 browsers write something like this:
This would generate files for IE8 and Firefox.

Some time measurements from our GWT project
only one browser:
- GWT compilation time: 39.436s
- total time for mvn clean install in GWT project: 1:35.403s

all browsers:
- GWT compilation time: 58.435s
- total time for mvn clean install in GWT project: 1:59.730s

20 seconds are worth the optimization.
You only have to keep in mind to NOT commit these changes to your source code repository when the real application should run on different browsers.

1 Kommentar:

  1. Permutations definition
    What is a permutation? , define Permutation, why we use permutation?