RequestFactory takes long time to handle responce

53 views
Skip to first unread message

Miroslav Genov

unread,
Oct 22, 2011, 10:47:22 AM10/22/11
to google-we...@googlegroups.com
Hello,

I'm encountering a strange issue with RequestFactory. The attached screenshots are showing detailed information regarding the size of the request and the response time of my code. 

Own Code computation time: < 100 ms 
Request Time: 3965 ms 

So the RequestFactory takes ~4 seconds for entity to json computation ?

Any ideas ?

Screen Shot 2011-10-22 at 5.24.02 PM.png
Screen Shot 2011-10-22 at 5.33.10 PM.png

Miroslav Genov

unread,
Oct 22, 2011, 10:48:01 AM10/22/11
to google-we...@googlegroups.com
Does anyone has encountered a similar issue ? 

Miroslav Genov

unread,
Oct 23, 2011, 3:31:36 AM10/23/11
to google-we...@googlegroups.com
Forgot to mention that the my version of GWT is 2.4.0 

Thomas Broyer

unread,
Oct 23, 2011, 12:24:40 PM10/23/11
to google-we...@googlegroups.com
Have you tried putting logs all over the place (use a ServiceLayerDecorator that overrides every method to add some logs, and override the RequestFactoryServlet's doPost to log before and after) to try to see where the sluggishness comes from?
Do you have any servlet filter (e.g. managing transactions) that could explain that?
There are a few instances of "synchronized(cache)" blocks which might benefit from using a "2-step check" (i.e. wrap "synchronized(cache) { foo = cache.get(...); if (foo == null) { foo = ...; cache.put(..., foo); } }" within a "foo = cache.get(...); if (foo == null) { /* previous block here */ } }" to avoid locking the cache when the looked up value is already in it). People have complained that such constructs with "synchronized" can slow down GWT-RPC, so it could very well slow-down RF too: http://code.google.com/p/google-web-toolkit/issues/detail?id=6740
(BTW, no, I never experienced this, but I'm still using an old pre-2.3 version, and I'm not using AppEngine)

Miroslav Genov

unread,
Oct 23, 2011, 1:17:02 PM10/23/11
to google-we...@googlegroups.com
Hello Thomas, 

I added some more logging statements to my code (doPost method and in the ServiceLayerDecorator) and here are the results:
2011-10-23 20:04:17.441
invoke executed in: 12 ms
2011-10-23 20:04:17.805
getProperty executed in: 0 ms
2011-10-23 20:04:19.273 - (all getProperty invocations are with 0ms time), i.e ~2 seconds lost in get property invocations 

Total time in do post:
doPost executed in: 3736 ms
Where my own code execution time is from: 
2011-10-23 20:04:17.428 
to
2011-10-23 20:04:17.441
i.e < 20  ms

Any other ideas ? 

Miroslav Genov

unread,
Oct 23, 2011, 1:43:07 PM10/23/11
to google-we...@googlegroups.com
It seems that GWT-RPC is working correctly, cause I have another part of my code which is retrieving the same list of entities with the same properties using GWT-RPC and the whole request is executed in: ~50ms

I think that there is a big performance bottleneck in RF's response handling. 

Reply all
Reply to author
Forward
0 new messages