I'm trying to find the best way to transfer data from server -> client using Google Web Toolkit (GWT). I have some JSON text I'd like to send, but the 2 options I've used for doing so have both been very slow.
Option 1: Server generates JSON string, parses this into Java objects (a serializable class I've made), sends list of these over RPC, objects then used by client side. The block here is the RPC connection, which is ridiculously slow at transferring & serializing objects.
Option 2: Server generators JSON string, does NO parsing work, RPC's to client as a string, client then parses into Java objects and deals with. The block here is the client side GWT JSON parsing library, which is slow as molasses (~7 seconds for 13 objects).
The only 'fast' option I've tried is one concatenated string of fields created by each instance of the serialized class, which is then split and chopped on the client side. However, this is sloppy and prone to breaking if the splitting character were ever used in the content being transferred.
Maybe I'm doing something totally, obviously wrong. But any knowledge of how to improve GWT JSON parsing times or RPC transfer times would be appreciated!
Cheers,
Paul