You probably can try the com.google.gwt.rpc.RPC module though it has
been experimental for awhile. It seems to be a more efficient way of
encoding and decoding.
To use it it is almost the same as the other RPC:
1- Inherit the module: <inherits name='com.google.gwt.rpc.RPC'/>
2- Have you service interface extends the
com.google.gwt.rpc.client.RpcService
Ex:
/**
* The client side stub for the RPC service.
*/
@RemoteServiceRelativePath("myService ")
public interface MyService extends RpcService {
MyComplexObject myMethod(String name);
}
3- Have your implementation extends from
com.google.gwt.rpc.server.RpcServlet
Ex:
@SuppressWarnings("serial")
public class MyServiceImpl extends RpcServlet implements MyService {
public MyComplexObject myMethod(String input) {
return null;
}
}
4- You need the Async the same way as the other RPC service:
Ex:
public interface MyServiceAsync {
void myMethod(String input, AsyncCallback<MyComplexObject> callback);
}
This is it.
On Jun 15, 9:07 am, Jonas <[email protected]> wrote:
> In my GWT program I parse a large xml file using JAXB on the server side
> and then convert these objects into DTO. They contain a lot of strings,
> doubles, and integers in a nested hierarchy. I'm using ArrayList as
> collection for the nested objects. The problem is that when I send this over
> RPC it takes around 16 seconds and the browser freezes. I first thought
> there was something wrong with JAXB or the DTO conversion but as you can see
> below they are very fast:
>
> DEBUG gwt-log:72 - - JAXB conversion time: 0.047 seconds
> DEBUG gwt-log:72 - - DTO conversion time: 0.015 seconds
>
> When I inspect the RPC call using FireBug I can see that the object being
> transferred is 4.6 kb and it says POST dispatch 111ms.
>
> When I inspect some more I can see that the function
> @com.google.gwt.user.client.rpc.impl.ClientSerializationStreamReader::readI
> nt()
> seems to be the culprit with 5428 calls and 6654ms total time.
> ::getString(I), ::readDouble(), ::readLong() are also called a lot with
> around 3000ms each.
>
> Am I doing something wrong here or should it really be this slow? ~16
> seconds for 5 kb of DTO data. It just seems wrong to me.
--
You received this message because you are subscribed to the Google Groups
"Google Web Toolkit" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/google-web-toolkit?hl=en.