Start networking and exchanging professional insights

Register now or log in to join your professional community.

Follow

How do I speed up the gwt compiler?

I'm starting to make heavier use of GWT in my projects, and the performance of the GWT compiler is becoming increasingly annoying. I'm going to start altering my working practices to mitigate the problem, including a greater emphasis on the hosted-mode browser, which defers the need to run the GWT compiler until a later time, but that brings its own risks, particularly that of not catching issues with real browsers until much later than I'd like. Ideally, I'd like to make the GWT compiler itself quicker - a minute to compile a fairly small application is taking the piss. However, I'm using the compile if a fairly naive fashion, so I'm hoping I can make some quick and easy gains. What can I do to get some extra speed? Can I give it more information so it spends less time doing discovery of what to do?

user-image
Question added by Mohamed Mansour , Java Developer , Arrow Electronics
Date Posted: 2013/05/14
moath Qassem
by moath Qassem , Backend Engineer , LOVOO GmbH

Simply run your code on a codeserver which comes out of the box and super dev mode and your application on another server like tomcat or the embedded server jitty 

George El Haddad
by George El Haddad , Software Engineer (Freelance) , Scientific Software Consultancy & Training

Very good question.
Being a GWT coder my self I have encountered this issue before.
I have resolved it by using hosted mode as you have mentioned and then testing it on multiple browsers.
But in the end you are going to have to compile it to really test it.
So here's what I found out about the GWT compiler on my quest to speed things up.
1.
Compilation is slow and you cannot get away from it.
2.
It is slow because the compiler compiles various versions of your app for different browsers.
3.
it is also slow because it takes into account locales as well, so more versions of your app.
So since you want to speed compile time for testing there are a few things you can do! This is the good news.
Now how fast will it be...
that's arbitrary but it should be faster than a full default compile.
You can tell GWT compiler to compile the app only for FireFox or only for IE ...etc.
This way it will compile 1 or 2 versions of your app and not more.
See these 2 links for more in depth information on how to get this done.
https://code.google.com/p/google-web-toolkit-doc-1-5/wiki/FAQ_CompileOnePermutation http://stackoverflow.com/questions/1011863/how-do-i-speed-up-the-gwt-compiler

Do you need help in adding the right keywords to your CV? Let our CV writing experts help you.