That's exactly it Ian. Additionally, I found that if I didn't cache it in a singleton, neither did GWT.create. So it redid it every time on the GWT.create call - on my q6600 desktop, it was about 2-4 seconds of overhead if I recall correctly. On my Turion 64 x2 2ghz laptop, it was 3-6 seconds. Also, even in web-mode, the advantage is you only call the constructor once per service (unless GWT caches it in a singleton for you - I'm not sure on this point, but I'd guess the answer would be that it doesn't), but presumably that wouldn't be a hotspot in your code anyways.
On Thu, Apr 23, 2009 at 5:53 PM, Ian Petersen <ispet...@gmail.com> wrote: > > On Thu, Apr 23, 2009 at 2:36 PM, Jason Essington > <jason.essing...@gmail.com> wrote: > > What Vitali meant was not so much that the call itself was expensive > > at runtime, but rather the object instantiation that would happen at > > runtime to create the new async implementation (the new MyAsyncImpl() > > call). > > I think he was actually talking about the cost in hosted mode only. > In web mode, the choices regarding what to return from GWT.create() > are already made and the call is no more expensive than any other > constructor invocation. In hosted mode things are different, though. > The GWT compiler runs incrementally in hosted mode so the first time a > given call to GWT.create() is encountered, the compiler has to do a > whole bunch of work. Vitali's suggestion lets you avoid running the > compiler until absolutely necessary which means that you can load your > app, click on the admin page and make sure that the save button works > without invoking any GWT.create() calls that manage customer RPCs. > It'll save you time when you're only looking at part of your app, > which is pretty typical for a dev environment. > > Ian > > > > --~--~---------~--~----~------------~-------~--~----~ 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-Web-Toolkit@googlegroups.com To unsubscribe from this group, send email to google-web-toolkit+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/Google-Web-Toolkit?hl=en -~----------~----~----~----~------~----~------~--~---