Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can I reduce GWT 2.7 Compilation to single permutation

Tags:

gwt

gwt-2.7

Step 1. Create a new GWT project via Google Plugin for Eclipse with GWT 2.7.0

Step 2. Modify the .gwt.xml to set linker to xsiframe

 <add-linker name="xsiframe" />

Step 3. Compile the project compilation-mappings.txt shows 6 entries - 5 with browser and one without

1737AD1FC03D9513CE7A9D806F3E21C3.cache.js
user.agent gecko1_8

263432CEAA7C118D6FF27B488528C7EF.cache.js
user.agent safari

3269EBD405702A848A8B082982A76805.cache.js
user.agent ie8

6ED13A4E7283CDD9B28BFDD052C8EC05.cache.js
user.agent ie9

EFB063823A3113BEB2C481F22CA51E1D.cache.js
user.agent ie10

Devmode:devmode.js

Step 4. Modify the .gwt.xml to set single browser with user.agent set to gecko1_8

<set-property name="user.agent" value="gecko1_8,ie9,ie10,safari" />
<set-property-fallback name="user.agent" value="gecko1_8" />
<set-property name="user.agent" value="gecko1_8" />

<!-- allow Super Dev Mode -->
<add-linker name="xsiframe" />

Step 5. Compile the project compilation-mappings.txt shows two entries without browser

FE1687414F0A6033B32B0F59A213285B.cache.js

Devmode:devmode.js

Also, the compilation log shows

Compiling module com.appbootup.explore.gwt.HelloWorld
   Compiling 1 permutation
      Compiling permutation 0...
   Compile of permutations succeeded
Linking into D:\workspace\GWork\HelloWorld\war\helloworld
   Link succeeded
   Compilation succeeded -- 6.434s

Question 1. Does the second permutation "devmode.js" cost us build performance time?

Question 2. Is there a way I can bring this further down to 1 permutation by eliminating "devmode.js". ?

like image 863
appbootup Avatar asked Nov 09 '22 21:11

appbootup


1 Answers

Question 1. Does the second permutation "devmode.js" cost us build performance time?

No, this file is built from a template, and costs nothing.

Question 2. Is there a way I can bring this further down to 1 permutation by eliminating "devmode.js". ?

Since question 1's answer is 'no', I'm not sure this is relevant. How long does it take to copy a single file? If it took longer than a few ms, I'd be very surprised.


For faster compilation, use super dev mode - I'd bet that 6.4 seconds drops to less than a second. Its no good of course for building for production, but it allows you to simply refresh the browser and will generate the new permutation very very quickly, based on changes you have node.

For faster production compiles, use draft mode, and make sure you inherit no more modules than absolutely necessary - the more unused code you have, the longer the build can potentially take.

like image 130
Colin Alworth Avatar answered Nov 15 '22 12:11

Colin Alworth