Win a copy of Think Java: How to Think Like a Computer Scientist this week in the Java in General forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Improved Compiler Performance for GWT: Reduce permutations

 
Cameron Wallace McKenzie
author and cow tipper
Saloon Keeper
Posts: 4968
1
Hibernate Spring Tomcat Server
  • Likes 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
So, I'm compiling like crazy, and I keep seeing twenty permutations being compiled by the Google Web Toolkit compiler. Anyways, I started thinking, "How can I reduce the number of permutations?"

Apparently, there's a permutation for each language and browser that your app supports. So, if you've got four browsers and three languages, you get at least twelve permutations. I think GWT defaults to supporting four browsers or something.

Anyways, but specifying only the browser you are using during local testing, you can greatly reduce the number of permutations, and greatly speed up complication. It's just set-property entry in the gwt.xml file for your module. So, to use only ie, you can make the following entry (I had to use Internet Explorer as my Chrome Dev release keeps crashing):

<set-property name="user.agent" value="ie6"/>

Other options are ie6, gecko1_8, safari...I'm not sure the that user.agent name is for Chrome. Gecko1.8 is Firefox apparently.

This took me down to only two permutations, and improved compiler performance time greatly.

Feel free to add on any other hints for improving the GWT compile time. I'd love to hear them!

-Cameron McKenzie
 
Karina Guenther
Ranch Hand
Posts: 65
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This helped me with my problem as well. I had about 7 modules each compiling 24 times taking 25 minutes. Added this statement cut the compile in half. I then realized I could use Eclipse to control which modules I was compiling based upon where I made my changes. Together this reduced my compiling times for testing down to a more manageable 2 minutes.
 
Rick Poleshuck
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You can use 2 agents by separating them with commas.
For example:
<set-property name="user.agent" value="ie6,gecko1_8"/>
 
Ulf Dittmer
Rancher
Posts: 42967
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Just as an FYI, all valid values can be found at https://gwt.googlesource.com/gwt/+/master/user/src/com/google/gwt/useragent/UserAgent.gwt.xml. The history of the file shows which permutations got enabled or disabled when and why. For example, "opera" no longer exists, because that now uses Webkit, the same rendering engine as Safari.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic