GWT-RPC vs HTTP Call - which is better??

75 views
Skip to first unread message

Nirmal

unread,
Jun 2, 2010, 12:58:21 AM6/2/10
to Google Web Toolkit
Hi,

I am evaluating if there is a performance variation between calls made
using GWT-RPC and HTTP Call.

My appln services are hosted as Java servlets and I am currently using
HTTPProxy connections to fetch data from them. I am looking to convert
them to GWT-RPC calls if that brings in performance improvement.

I would like to know about pros/cons of each...

Also any suggestions on tools to measure performance of Async calls...

Regards,
Nirmal

Saima Waseem

unread,
Jun 2, 2010, 12:59:51 AM6/2/10
to google-we...@googlegroups.com
Animal-movie.com!    Lates Movie
 
Watch Live Match!  ootbal World Cup 2010

rudolf michael

unread,
Jun 2, 2010, 1:23:21 AM6/2/10
to google-we...@googlegroups.com
well RPC is better and i do suggest to change your HTTP calls to RPC calls.
Using RPC, you have the option to pass your POJO classes from client to server and vice versa, so this will exempt you from the parsing.

I am not sure about it but i guess that RPC is faster than HTTP and the performance is far more better.

regards,
Rudolf Michael

On Wed, Jun 2, 2010 at 7:59 AM, Saima Waseem <saimawa...@gmail.com> wrote:
Animal-movie.com!    Lates Movie
 
Watch Live Match!  ootbal World Cup 2010

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

Sripathi Krishnan

unread,
Jun 2, 2010, 2:42:18 AM6/2/10
to google-we...@googlegroups.com
In general, you should use GWT RPC; it is pretty good for most use cases. You can always optimize later if needed.

Comparing various methods
GWT RPC is also a HTTP call. The only difference is in the (de)serialization mechanisms employed by each method. There really isn't a single good solution, you have to choose what is best for your use case.

The regular RPC and the experimental deRPC both allow you to send java serializable objects to the client side. The regular RPC method has custom serializers and deserializers written in javascript, which can get expensive if you have deep object hierarchies. The experimental deRPC tries to eliminate custom serialization code, but increases the size of the RPC payload. 

You can use RequestBuilder to download JSON/JSONP data. This is useful if you have a non-java backend, or if you have existing JSON services that you'd like to reuse. Its also necessary if you need to make cross-domain requests. The flip side is that you need to use Javascript Overlays on the client side if you want maintainability and good performance. 

You can also use XML - but that is not recommended. JSON is always a better option than XML, since browsers natively understand JSON.

Measuring Performance
Tools like firebug/charles etc. will only tell you the time taken to transport the payload. In addition to this, the browser also has to deserialize the response, and then execute the callback, and these steps do take time. GWT's lightweight metrics system lets you accurately measure the time taken by each step.

--Sri


Stefan Bachert

unread,
Jun 2, 2010, 2:30:44 PM6/2/10
to Google Web Toolkit
Hi,

in general use GWT-RPC (as Sri wrote).
However, the only case I would you classical HTTP is, when you need to
download image data which are business datas (and not static images
which should be located in a ClientBundle).

Stefan Bachert
http://gwtworld.de
Reply all
Reply to author
Forward
0 new messages