Win a copy of Micro Frontends in Action this week in the Server-Side JavaScript and NodeJS forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Bear Bibeault
  • Junilu Lacar
  • Jeanne Boyarsky
  • Tim Cooke
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • salvin francis
  • Frits Walraven
  • Scott Selikoff
  • Piet Souris
  • Carey Brown

Improved Compiler Performance for GWT: Reduce permutations

author and cow tipper
Posts: 5000
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
Ranch Hand
Posts: 79
  • 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.
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"/>
Posts: 43016
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Just as an FYI, all valid values can be found at 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.
For my next feat, I will require a volunteer from the audience! Perhaps this tiny ad?
the value of filler advertising in 2020
    Bookmark Topic Watch Topic
  • New Topic