I am transferring a list of objects to the client with GWT Request Factory. The objects contain only a couple of strings and the list does only contain 20 objects. To transfer this small list of data, it takes over a second. First I thought the query needs to be optimised. But the measurement shows:
The retrieval of the objects from the database only takes
300ms
The transfer to the client takes in total over a second
1136ms
So this seems to be request factory overhead. I already use my own ServiceLayerDecorator
and have overridden the isLive()
function so it always return true
. Are there any other actions I can take to speed this up and bring the performance to an acceptable area?
Update:
I created the logic to copy my entity object data to DTO and transfered them with RPC to compare the RPC and Request factory peformance. As you can see the RPC logic is much faster. Now I am wondering if that is by design or if there is a flaw in my application.
20 transfered objects:
Request factory: 1252 ms
RPC: 420 ms
28 transfered objects:
Request factory: 1654 ms
RPC: 460 ms
78 transfered objects:
Request factory: 3963 ms
RPC: 769 ms
============================================================
Update2
So I wrote a very simple sample application to make sure my application does not have any filters or other interfering components. The applications loads 10 objects with 4 String fields from the server. I did it with Request factory as well as RPC and stopped the time.
The code can be found here: https://github.com/jan10101/requstFactoryVSRPC
A life demo here: http://requestfactorytest.appspot.com/
The test application confirms my observation: The request factory performance is really bad compared to the RPC performance. In dev mode the performance of RPC is about 40 times better, in production mode still 4 times. Am I the first one noticing the performance issues?
The following screenshots show the test results if you don't want to try it yourself.
Results in dev mode:
Results of productive code (on app engine):
I'm not sure how relevant this is to your specific case, but the problem may be AutoBeans. RequestFactory makes extensive use of AutoBeans.
I have recently been able to solve a performance problem in a GWT application by reducing the use of AutoBeans, which seem to be very slow. The use of a hierarchical perfomance profiler such as the one in IE's F12 tools identified the Autobean code as the root of the problem, so the performance problem was client-side. IIRC the solution was to copy the AutoBeans to "real" Java objects after completion of the call.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With