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).

The idea is that it is more efficient to reuse a single instance of  
the service than it is to create a new one (object) each time you want  
to send an RPC. I haven't profiled it, so I can't say really how much  
of a hit it is, but I'm inclined to believe that it isn't terrible  
(particularly with JS engines in Safari 4 or Chrome). That said, I do  
use singletons for my services.

This is probably a good area to study a bit however. particularly if  
you have many different RPC services. Is it better to make singletons  
of every service which occupy some amount of memory for the life of  
the application, or create a disposable one each time you call an RPC?  
Is there a memory / performance trade off? And would this trade off be  
different in say IE vs Safari?

-jason

On Apr 23, 2009, at 1:31 PM, JoeB wrote:

>
> Why is the call to GWT.create(MyService.class) expensive at run-time?
> The code generation all occurred at compile-time, so what's actually
> happening at run-time?
>
> -- Joe
> >


--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to