my biggest problem with gwt

123 views
Skip to first unread message

Dennis Haupt

unread,
Jul 15, 2011, 7:23:24 AM7/15/11
to google-we...@googlegroups.com
it's the speed. not the execution speed, that one is good enough.
what i mean is the compilation speed. compiling my complete java project takes 30 seconds. compiling the tiny gwt part of it takes 91 seconds. activating the hosted mode takes about 1-2 minutes (didn't measure, feels like it). debugging like this takes forever.

the write - test - debug - fix - cycle slows me down a lot. is there any way to fix that problem?

Juan Pablo Gardella

unread,
Jul 15, 2011, 7:34:04 AM7/15/11
to google-we...@googlegroups.com
mmm I work in this manner. I use maven, but is the same.

1) Make the war (mvn package). Only the first time.
2) Start dev mode.
3) Open browser (I use IE, is the fastest in dev mode). Wait at first time a minute.
4) Test the app and modify code.
5) Refresh page in IE. Wait 10s aprox.
6) Repeat 4) and 5).

So, first time is slow, but then is productive.

Juan


2011/7/15 Dennis Haupt <d.ha...@googlemail.com>
it's the speed. not the execution speed, that one is good enough.
what i mean is the compilation speed. compiling my complete java project takes 30 seconds. compiling the tiny gwt part of it takes 91 seconds. activating the hosted mode takes about 1-2 minutes (didn't measure, feels like it). debugging like this takes forever.

the write - test - debug - fix - cycle slows me down a lot. is there any way to fix that problem?

--
You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group.
To post to this group, send email to google-we...@googlegroups.com.
To unsubscribe from this group, send email to google-web-tool...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.

Aidan O'Kelly

unread,
Jul 15, 2011, 7:37:34 AM7/15/11
to google-we...@googlegroups.com
There is a google IO session which covers speeding up the compile
process during development, it is in the second half of a talk on the
compiler in general.
http://www.youtube.com/watch?v=qT6ZsQBM7kY

Also, if you are working on client side code, a lot of the time you
don't need to go through the whole re-compile process. You can simple
edit your client side .java files, save, then refresh your browser.
GWT will recompile just the changed code.

Rob Coops

unread,
Jul 15, 2011, 7:46:45 AM7/15/11
to google-we...@googlegroups.com
--
You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group.
To post to this group, send email to google-we...@googlegroups.com.
To unsubscribe from this group, send email to google-web-tool...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.

The speed of compilation and the starting in the dev server is indeed a little slow, but then again if you look at what it is doing...

Take Java code and transform that into javascript and html, then rinse and repeat 6 times for all supported browsers and versions. Then repeat that n times once for each language specified. In the end that means that where you compile your java project once you compile your gwt bit at least six times yet it only takes 3 times as long...
One thing I did to speed things up is remove all languages other then default this saves a lot of compilation steps and reduces the time it takes to compile significantly. After all once you have confirmed that a string is translated there is little point in doing that again for every debug round.

Another easy thing to do is reduce the compilation amount, do you really need to recompile every single time? Most of the changes in your code can be tested without having to recompile just redeploy the solution and all client side code will/should (it does sometimes fail) run in the new updated version.
Also pretty much all professional outfits use a nightly build to put the whole lot together, build and deploy it all beyond that most of the time developers work on their own portion of the code which they can compile and test without always needing to compile the full project.

Then there is one other thing which I know won't sound nice but it is true. A gut feeling of 1 minute or even several minutes usually turns out to be way less then that. Just like with performance testing you cannot trust your feelings you have to measure things before you can say for sure. For instance it has been found that one can make an application a lot faster by showing the user a progress bar and status messages about what the program is doing. The program is no faster but the user has the feeling stuff is happening thus they feel that things are going faster even though there is no factual difference in the execution speed.
So never trust a feeling, at least not when it comes to the measuring of idle time waiting for a computer, as it is very often quite far of from reality.

Regards,

Rob

dreamer

unread,
Jul 15, 2011, 7:54:23 AM7/15/11
to Google Web Toolkit
=>activating the hosted mode takes about 1-2 minutes (didn't measure,
feels
like it). debugging like this takes forever.

Yep. Documentation says use this mode always during development, never
to compile.
Bringing up dev mode URL is taking time (with debug option).

Not sure selecting particular browser helps dev mode, seems like,
after dev mode url lauch only,
It bring up the javabyte code to javascript to browser. So I don't see
a reason to choose various permutations and combinations.

Looks that single path of bytecode->javascript->browser - is taking
time.

On like Sessions are telling some tricks to speed up compilation, but
also suggesting never to compile during develop, just develop in java.
Did not find any clues, how to speed up Dev life cycle (hosted
mode) ,

This should come out of the box. (eclipse plug in + browser plug in -
who does what I am not sure)
Hopefully GWT team will address this.

For sure hosted mode is the way to go during development.


On Jul 15, 4:37 am, "Aidan O'Kelly" <aida...@gmail.com> wrote:
> There is a google IO session which covers speeding up the compile
> process during development, it is in the second half of a talk on the
> compiler in general.http://www.youtube.com/watch?v=qT6ZsQBM7kY

Alain Ekambi

unread,
Jul 15, 2011, 8:00:12 AM7/15/11
to google-we...@googlegroups.com
I m pretty sure the GWT team is allready on making  dev mode run even faster.
I heard they are obsessed about speed @Google :)
But  when you think about it a second  what devmode does you will see that performance is pretty good right now. I mean this is Javabyte code remotelly manipulating  your browser. To be able to run the way it does at the moment is pretty impressive to me.

2011/7/15 dreamer <venugopal...@gmail.com>



--


vinayak kulkarni

unread,
Jul 15, 2011, 8:23:45 AM7/15/11
to google-we...@googlegroups.com
This is because GWT compiles the javascript for all the browsers.. around 5 browsers - 10 permutations..
For the development mode, you can compile only for one browser. Ex: for IE, use the below property in *.gwt.xml file

This would reduce your compile time..

vinayak kulkarni

unread,
Jul 15, 2011, 8:26:04 AM7/15/11
to google-we...@googlegroups.com

Magno Machado

unread,
Jul 15, 2011, 8:29:03 AM7/15/11
to google-we...@googlegroups.com
For compiler speed, on development builds you can reduce the number of permutations (restrict user agents, locales, etc)

I have a sample app here which does that: https://bitbucket.org/magnomp/gradlegwt, but uses Gradle for build.

Anyway, most of the time you will be using devmode, not the compiler. And on devmode, you don't have to re-launch it everytime you change the code, you can simply refresh the browser and it will use your new source code.

And one point which is not mentioned that often, is that you can use mvp, unit tests and etc to reduce the times you have to go in devmode to test your app

Dennis Haupt

unread,
Jul 15, 2011, 11:09:18 AM7/15/11
to google-we...@googlegroups.com
that helped most, thanks

2011/7/15 vinayak kulkarni <bkvi...@gmail.com>

--
You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group.

Dennis Haupt

unread,
Jul 15, 2011, 11:12:51 AM7/15/11
to google-we...@googlegroups.com
switching to dev mode took 41 seconds, chrome became responsive again about ~30 seconds after that. gut feeling wins.

2011/7/15 Rob Coops <rco...@gmail.com>

Paul Robinson

unread,
Jul 15, 2011, 11:24:41 AM7/15/11
to google-we...@googlegroups.com
Chrome is slow in dev mode. Try firefox instead.

dreamer

unread,
Jul 15, 2011, 11:57:30 AM7/15/11
to Google Web Toolkit
just off topic. what is life cycle in dev mode?

Is it java byte code all the way to browser (plug in )? (I mean no
java script any where)

Chris Conroy

unread,
Jul 15, 2011, 12:20:56 PM7/15/11
to google-we...@googlegroups.com
http://code.google.com/p/google-web-toolkit/wiki/DesignOOPHM gives a decent overview and specs out the wire protocol.

High level:
The bootstrap page detects the ?gwt.codesvr= fragment, and tries to load the plugin.

The plugin then validates the permissions. Assuming the permissions are good, it connects to the code server.

The code server then does a JDT compile, runs generators, etc... Then it runs the module entry point.

Any java code runs in the JVM on the code server. For any JSNI (that includes JSNI in GWT core such as the standard DOM accessors), those function calls go across the wire to the plugin where they are evaluated in the Browser's Javascript VM in the context of the application.

Java objects referenced by JSNI functions get wrapped by the plugin so JS code can reference an object that lives in the JVM. One of the causes of slowness in the Chrome plugin is v8 has an identity bug with NPObjects that requires us to round trip to v8 and compare our own custom tags on every identity comparison for a Java object. This is actively being worked on and we should be able to ship a speed improvement build for recent builds of chrome shortly.


Michael Allan

unread,
Jul 15, 2011, 12:22:19 PM7/15/11
to google-we...@googlegroups.com
Dennis Haupt wrote:
> that helped most, thanks

More on that here:
http://code.google.com/webtoolkit/doc/latest/FAQ_DebuggingAndCompiling.html#Can_I_speed_up_the_GWT_compiler?

The allowable values for user.agent are defined here:
http://code.google.com/p/google-web-toolkit/source/browse/trunk/user/src/com/google/gwt/user/UserAgent.gwt.xml

Myself, I find that devmode ("hosted mode") is fast enough. It's slow
to launch in the first place (15 s), but it re-compiles quickly when I
hit refresh (3 s).

> vinayak kulkarni wrote:
> > This is because GWT compiles the javascript for all the
> > browsers.. around 5 browsers - 10 permutations.. For the
> > development mode, you can compile only for one browser. Ex: for
> > IE, use the below property in *.gwt.xml file

--
Michael Allan

Toronto, +1 416-699-9528
http://zelea.com/

Toby Reyelts

unread,
Jul 25, 2011, 8:54:33 PM7/25/11
to google-we...@googlegroups.com
GWT RPC has been particularly offensive when it comes to being slow in Chrome. If you're using RPC, try running GWT from SVN head. You should see a massive improvement in Chrome performance.
Reply all
Reply to author
Forward
0 new messages