How to speed up Hosted mode

677 views
Skip to first unread message

maticpetek

unread,
Apr 18, 2011, 7:49:49 AM4/18/11
to google-we...@googlegroups.com
Hello,
   We are developing our app in GWT now for a couple of years. And code base is becoming bigger every day.... And hosted mode is also become very slow. Refresh in browser takes around 1 minute. Forms opening a couple of seconds. All this time my CPU is on around 160% (if I look Activity monitor). This happend in FF. Chrome is not useful because it takes too much time (I gave up after 10 minutes). 
   Any idea how could we speed up hosted mode? Would code split with GWT.runAsync do any help? Or on the end you just must have very fast CPU? Thank you for help.

My environment :
- OS X Show Leopard 
- JDK 1.6
- GWT 2.2
- GXT 2.2.3
- Firefox 3.6

Regards,
   Matic
------------------
GWT stuff twitter  - http://twitter.com/#!/gwtstuff

Juan Pablo Gardella

unread,
Apr 18, 2011, 7:53:56 AM4/18/11
to google-we...@googlegroups.com
+1

2011/4/18 maticpetek <matic...@gmail.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.

Žiga Skalar

unread,
Apr 18, 2011, 8:33:07 AM4/18/11
to google-we...@googlegroups.com
+1

Palo G.

unread,
Apr 18, 2011, 9:33:32 AM4/18/11
to Google Web Toolkit
Hi,

we were facing same problem as you - our codebase for client side has
thousands of classes, server side too. Only possible solution was to
slpit whole project into maven sub-projects and create new dynamic
architecture of whole project - cliend and server side.

For now, our system consist from about 20 well defined maven
subprojects which are logical system components. An logical componet
consist from other sub-projects [gwt-client], [gwt-server], [core],
[api]. This gave us very good results, because, every subproject can
be unit tested, gwt-client can be stared in hosted mode using mocking
services. All development process is now very well defined. GUI
developers can code gwt code and test it against mocked services.
Server gyus are just developing services on server and testing
services in unit tests. And in the end everything will be joined to
one piece when release time will come.

We are not using hosted mode above the whole application. It can be
done, because required HW resources are such huge. Hosted mode is
started only above subprojects [gwt-client].

Yes of course this approach has so much boilerplate things. But it
works. Honestly I'm afraid to start whole application in hosted
mode.

Palo

mike b

unread,
Apr 18, 2011, 9:47:56 AM4/18/11
to google-we...@googlegroups.com
FYI... below are my specs. We have about 50 Views across 6 async modules ( as defined by mvp4g).  Refresh on my system only takes a few seconds.  On my co-worker's identical machine it takes 10+ seconds. The only difference that I know of is that he is using the gwt 2.1.1 eclipse plugin. 


Windows quad core 2.8 ghz, 3.5GB
gwt 2.2
gwt eclipse plugin 2.2
jdk 1.6
FF 3.6
IE7
Eclipse 3.6
mvp4g 1.3.1
jboss 5


Good luck,
m

Paul Stockley

unread,
Apr 18, 2011, 10:21:41 AM4/18/11
to google-we...@googlegroups.com
I've seem various check-ins in the code base related to caching the state of dev mode and code generators so you only have to pay the price of compiling everything once. Reloads after this are incremental. Not sure when this is scheduled to be released. 

maticpetek

unread,
Apr 18, 2011, 10:33:02 AM4/18/11
to google-we...@googlegroups.com
Palo,
  Thank you for solution with subproject. But I hope this will be my last step. I know that from architecture view & test driver development, separation between client and server, MVC, etc is right approach, but I really like this simple approach with Eclipse. Just code, run & debug in Eclipse, view result in FF or Safari, use FireBug, commit code into SVN, build with ant and publish. No libraries with versions, part working application, all functionality of application is a front of you.

Mike,
  Maybe I should really try code separation GWT.runAsync.

Paul,
  It look like the next versions of GWT will come with speed increase for us. I hope someone from GWT team would say something more about that....

Regards,  
   Matic

Paul Stockley

unread,
Apr 18, 2011, 11:03:46 AM4/18/11
to google-we...@googlegroups.com
I am not sure runAsync would make any difference to dev mode. I think all the code still has to be compiled each time.

mike b

unread,
Apr 18, 2011, 11:51:35 AM4/18/11
to google-we...@googlegroups.com
I just remembered one other major difference between my environment and my coworker's...  I downloaded the gwt 2.2 code branch from google and compiled it with only ie6 and gecko1_8 enabled. (see UserAgent.gwt.xml in gwt-user.jar)

Maybe async will help you compile only what has changed, rather than everythying?  This conversation just went out of my (so seamingly small) realm of knowledge!!!

Good luck,
Mike

DaveC

unread,
Apr 18, 2011, 4:02:30 PM4/18/11
to Google Web Toolkit
I might be on the wrong track but have you checked the temp directory
where java writes out files (on windows xp it's something like c:/
documents and settings//*user*/localsettings....) I regularly (once a
week) have to clear tens of thousands of files and GBs of data
otherwise eclipse (and lotus notes) comes to a crawl...

Jeff Larsen

unread,
Apr 18, 2011, 4:24:20 PM4/18/11
to google-we...@googlegroups.com
Lotus notes.... ouch!

jaga

unread,
Apr 19, 2011, 4:05:27 AM4/19/11
to Google Web Toolkit
I noticed that if the temp directory wasn't cleared Eclipse took
longer and longer to start up. Up to 10 minutes. I wrote a simple
script which runs every boot to clear out the offending files. I am
not sure if this affects the compilation performance or not.

On Apr 18, 9:24 pm, Jeff Larsen <larse...@gmail.com> wrote:
> Lotus notes.... ouch!

DaveC

unread,
Apr 19, 2011, 4:07:47 AM4/19/11
to Google Web Toolkit
I've also noticed that moving from a GWT 1.7 version of building apps
to the 2.1 way (UiBinder CellWidgets etc) makes a noticable
difference... (less java/ecmascript code I guess).

maticpetek

unread,
Apr 19, 2011, 4:20:27 AM4/19/11
to google-we...@googlegroups.com
mike b,
  This is something to try - if I only change code in async block, maybe it will recompile only this part. But this will note have any effect on startup time.

Palo G.

unread,
Apr 19, 2011, 9:26:40 AM4/19/11
to Google Web Toolkit
The main problem is that every time when hosted mode is started all
classes are loaded. When you refresh hosted mode and your classes
doesn't implement Serializable then these classes will be realoaded
even when they were not modified. I don't really now if this will work
for GWT hosted mode, but works for other containers like Tomcat (GWT
used tomcat lite while ago i'm not sure what are they using now).

Maybe this can speed up your hosted mode refresh operation. And of
course set only one language and browser support.

Thomas Broyer

unread,
Apr 19, 2011, 9:57:23 AM4/19/11
to google-we...@googlegroups.com


On Monday, April 18, 2011 1:49:49 PM UTC+2, maticpetek wrote:
Hello,
   We are developing our app in GWT now for a couple of years. And code base is becoming bigger every day.... And hosted mode is also become very slow. Refresh in browser takes around 1 minute. Forms opening a couple of seconds. All this time my CPU is on around 160% (if I look Activity monitor). This happend in FF. Chrome is not useful because it takes too much time (I gave up after 10 minutes). 
   Any idea how could we speed up hosted mode?

Always use the latest GWT version: http://twitter.com/salvadordiaz/status/55177780895293440 (unless it adds many new features that you don't need; see below about classpath/sourcepath)
GWT 2.4 (won't be in 2.3 AFAIK) will add an (optional) cache that will speed things up even more (I haven't tried it yet though) so try running from trunk if you can: http://code.google.com/p/google-web-toolkit/source/detail?r=9893

Would code split with GWT.runAsync do any help?

GWT.runAsync actually runs synchronously in DevMode, so it won't help.
 
Or on the end you just must have very fast CPU? Thank you for help.

I believe memory and a fast disk are more important than a fast CPU.

Trimming down your classpath and your "source path" (paths listed as <source> or <super-source> in your *.gwt.xml files) should help.


My environment :
- OS X Show Leopard 
- JDK 1.6
- GWT 2.2
- GXT 2.2.3
- Firefox 3.6

Remove GXT from the equation! (half-kidding only)

zundel

unread,
Apr 19, 2011, 11:32:04 AM4/19/11
to google-we...@googlegroups.com
One thing you can try that I believe will be in GWT 2.3 is to set the experimental GWT flag -XenableGeneratorResultCaching.  It gives a modest speedup if your app uses a lot of client bundles.

Thomas is referring to the new "PersistentUnitCache" class we've been working on.  It isn't ready in GWT 2.3, but if you checkout GWT trunk, you can give it a try by adding -Dgwt.persistentunitcache -Dgwt.persistentunitcachedir=/tmp/<user> to your JVM args when invoking DevMode.  It won't seem any faster the first time you start dev mode, but should be 40-50% faster on subsequent restarts. 

The initial build of all classes can be helped by trimming down your source path as Thomas says.  One tool to help you do this is to run the compile report (add -compileReport to your command line), and then  brows to the 'soyc' directory and pull up index.html in a web browser.  Under compiler metrics you will find a list of all sources that were compiled, but remained unreferenced at the end of the build.  Sometimes you can re-define your .gwt.xml module files to exclude sources from the build that are not needed.

Aladdin

unread,
Apr 19, 2011, 8:06:01 PM4/19/11
to Google Web Toolkit

I know that you can use cluster to compile your app

So , 2000$ can build you 6 diskless computers :)

Look that up in youtube or google

Karthik Abram

unread,
May 19, 2011, 12:12:49 PM5/19/11
to google-we...@googlegroups.com
As bizzare as it sounds, try IE 9 - seems to run faster than FF in dev mode.

Juan Pablo Gardella

unread,
May 19, 2011, 1:35:43 PM5/19/11
to google-we...@googlegroups.com
Yes, in dev mode use IE it's much faster.

2011/5/19 Karthik Abram <karthi...@gmail.com>

maticpetek

unread,
May 23, 2011, 1:36:45 AM5/23/11
to google-we...@googlegroups.com
@kabram and Juan - thank you for IE testing. "Unfortunately" we are all developing on OSX....

After watching IO 2011 talks about GWT & performance, we will also refine our RPC methods - we should remove "List" and "Object" from method calls.
Reply all
Reply to author
Forward
0 new messages