GWT Optimization - Speed up the compilation in Eclipse

Do you have a computer with n-cores (in my case I have 4) and you are frustrated that the GWT compilation, on such powerful machines, works so slow?

Don't despair ...there is a solution here. Here's how we improve this in Eclipse:
- click on the "GWT Compile" button, like in the below image:



- in the next dialog set the compilation parameter:
-localWorkers 4



How to know the number of worker threads used by the GWT compiler? very simple check out the "Task Manager" of your computer (CTRL+ALT+DEL and choose option 'Show Task Manager'), and see how many "CPU Usage History graphs" do you have (as I said before, I have 4).




In my case, the improvement was about 3x times, from the ~180sec to about ~60sec. Not bad, ehh?

Cheers,
Happy compiling!

2 comments:

  1. hey man!
    how do you set this parameters into the gwt-maven plugin?
    thank you for your help :D

    ReplyDelete
  2. You have to use the goal "gwt:compile" that supports extra GWT compiler parameters.

    It can be set from command line using:

    '-Dgwt.localWorkers=4'.


    Anyways, you can find the complete list of "gwt:compile" parameters here http://mojo.codehaus.org/gwt-maven-plugin/compile-mojo.html

    Cheers!

    ReplyDelete