title: Bad GWT Request Factory performance for list of objects
body: <p>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:</p>
  
  <p>The retrieval of the objects from the database only takes</p>
  
  <p><code>300ms</code></p>
  
  <p>The transfer to the client takes in total over a second</p>
  
  <p><code>1136ms</code></p>
  
  <p>So this seems to be request factory overhead. I already use my own <code>ServiceLayerDecorator</code> and have overridden the <code>isLive()</code> function so it always return <code>true</code>. Are there any other actions I can take to speed this up and bring the performance to an acceptable area?</p>
  
  <p><strong>Update:</strong></p>
  
  <p>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.</p>
  
  <p>20 transfered objects:</p>
  
  <p><code>Request factory: 1252 ms</code></p>
  
  <p><code>RPC: 420 ms</code></p>
  
  <p>28 transfered objects:</p>
  
  <p><code>Request factory: 1654 ms</code></p>
  
  <p><code>RPC: 460 ms</code></p>
  
  <p>78 transfered objects:</p>
  
  <p><code>Request factory: 3963 ms</code></p>
  
  <p><code>RPC: 769 ms</code></p>
  
  <p>============================================================</p>
  
  <p><strong>Update2</strong></p>
  
  <p>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.</p>
  
  <p>The code can be found here:
  <a href="https://github.com/jan10101/requstFactoryVSRPC" rel="nofollow noreferrer">https://github.com/jan10101/requstFactoryVSRPC</a></p>
  
  <p>A life demo here:
  <a href="http://requestfactorytest.appspot.com/" rel="nofollow noreferrer">http://requestfactorytest.appspot.com/</a></p>
  
  <p>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?</p>
  
  <p>The following screenshots show the test results if you don't want to try it yourself.</p>
  
  <p>Results in dev mode:</p>
  
  <p><img src="https://i.stack.imgur.com/pOu0C.png" alt="enter image description here"></p>
  
  <p>Results of productive code (on app engine):
  <img src="https://i.stack.imgur.com/86DlL.png" alt="enter image description here"></p>