4

How do I do for my larg GWT project, the compile time is going large more and more. If the best way is splitting the module to multiple modules, how can I do this.

RGDS

Nav
  • 4,450
  • 10
  • 53
  • 84

3 Answers3

4

I don't think that splitting project to modules will help. to the contrary it even can slow compilation. Speed of compiling depends on number of permutations which GWT compiles.

What you can do:

  • Compile GWT project only for 1 web browser. You can define this explicitly in GWT configuration file. <set-property name="user.agent" value="ie6"/> Other options are ie6, gecko1_8, safari.

  • Reduce number of used languages (for development stage). Use only 1 locale.

Igor Konoplyanko
  • 9,176
  • 6
  • 57
  • 100
  • I did both of them, but my project is large with many java classes so the compile time is very long about 4min. – Nav Dec 30 '10 at 11:37
  • What does GWT compiler output says ? It usually writes how much permutations it generates. And which version of GWT are you using ? – Igor Konoplyanko Dec 30 '10 at 12:32
  • if it takes only one permutation and still very slow - then you have to digg deeper. One more thing - compilation time may increase dramatically with side libraries used. Inspect your project for redundant code, and try to optimize it. – Igor Konoplyanko Jan 07 '11 at 10:40
3

The GWT compiler is inherently slow. Konoplianko provided some optimizations in his answer, but this will only go so far. There are 2 more compiler options that will help. You can play around with the number of worker threads, usually going from 1 to 2 will help and sometimes 3, but depending on your system it will hurt compile time when you get above a certain point(usually 3 in my experience). Also you can use the -draftCompile option if you are using 2.1. GWT was architected with the intention that you only compile when you intend to deploy something not during development. It was intended that you use hosted mode for development because it can keep track of what has changed and only recompile what is needed instead of having to recompile everything. I am not sure if it would help but changing the output from OBF to DETAILED or vice-versa might effect compile time.

LINEMAN78
  • 2,562
  • 16
  • 19
1

Here is two topic that I think will be helpful to you

How to get GWT to compile multiple modules and How do I speed up the gwt compiler?

Community
  • 1
  • 1