my dog learned polymorphism*
The moose likes GWT and the fly likes Improved Compiler Performance for GWT: Reduce permutations Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » GWT
Bookmark "Improved Compiler Performance for GWT: Reduce permutations" Watch "Improved Compiler Performance for GWT: Reduce permutations" New topic
Author

Improved Compiler Performance for GWT: Reduce permutations

Cameron Wallace McKenzie
author and cow tipper
Saloon Keeper

Joined: Aug 26, 2006
Posts: 4968
    
    1

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

Joined: Sep 16, 2005
Posts: 50
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

Joined: Aug 31, 2011
Posts: 1
You can use 2 agents by separating them with commas.
For example:
<set-property name="user.agent" value="ie6,gecko1_8"/>
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 41106
    
  45
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.


Ping & DNS - my free Android networking tools app
 
 
subject: Improved Compiler Performance for GWT: Reduce permutations
 
Similar Threads
Insertion of css, Java Script and Images
Very General GWT Question for authors
Hour 17:Creating Interactive Web Programs - Java in 24 hours
read the full file path
Struts2 updating issue in IE browsers