:) I see.
My question was related to documentation, because I've heard you to say
that some RF parts are working "by design", so I was wondering where there
is a such a document, that describes it. I know that GWT project has some
Wiki pages about RF, but non of them is explaining in details the format of
the request/response messages.
I'm digging into the source, to find out how the things are working and to
find a way to make some optimization on the server side, cause It's really
slow. 50 small entities are serialized in ~10 seconds on GAE, where with
GSON, the serialization takes 300 ms. I made profiling of a simple request
that doesn't accept any parameters and returns 50 entities.
Here is the test code that is making the request and measures the request
time:
public void testMethodReturningLargeDataSet() {
delayTestFinish(DELAY_TEST_FINISH);
SimpleFooRequest request = simpleFooRequest();
final long start = System.currentTimeMillis();
request.returnValueProxies().to(new Receiver<List<SimpleValueProxy>>() {
@Override
public void onSuccess(List<SimpleValueProxy> response) {
long end = System.currentTimeMillis();
System.out.println("Size: " + response.size() + " Time: " + (end -
start) + " ms");
}
}).fire();
}
Result time of this test is: Size: 50 Time: 1336 ms, where with gson, the
serialization time of this 50 objects is ~ 300 ms which means that RF is 4
times slower then the simple json serialization.
The profiler is saying that: SimpleRequestProcessor.process method is
taking 58% of the processing time, where:
createReturnOperations - 20%
- EntityCodex.encode 10%
- AutoBeanUtils.getAllProperties() 4%
- setTypeToken - 2%
- Other invocations - 3%
processInvocationMessages - 37%
- resolveClientValue - 28%
- ServiceLayerDecorator.invoke (Service method invocation) - 1 ms (0%)
- EntityCodex.encode - 9%
Thomas, do you have any thoughts about some optimizations of RF ?
On Tuesday, March 27, 2012 12:14:11 PM UTC+3, Thomas Broyer wrote:
>
> The specification is the code ;-)
> Have a look at the com.google.web.bindery.requestfactory.shared.messages.*
> classes for the payload data, and the AbstractRequestContext and
> SimpleRequestProcessor for how their semantics.
> In the ResponseMessage, there will either be general failure (causes
> onFailure to be called on all Receivers, including most importantly the
> "global" one, optionally passed to the fire() method of the
> RequestContext), violations (same as a general failure, but
> onConstraintViolations will be called instead of onFailure) or all three of
> operations, status codes and invocation results (actually, status codes and
> invocation results go by pair, and either one of operations or
> status-codes/invocation-results could be empty, but I don't think they
> could both be). Operations are data about proxies (have they been
> created/updated/deleted, along with their properties, as requested by the
> with() on the Requests); status codes gives the result/failure status of
> each method invocation (will trigger either onSuccess or onFailure of the
> Receiver associated with the method invocation) and invocation results
> (paired to the status codes by their index in the lists) will be either a
> ServiceFailureMessage (passed on onFailure) or the result (passed to
> onSuccess), depending on the status code.
>
> On Monday, March 26, 2012 10:11:20 PM UTC+2, Miroslav Genov wrote:
>>
>> Hello,
>>
>> Does anyone knows where there is a specification of the wire format which
>> RF is using by default ?
>>
>> Regards,
>> Miroslav
>>
>
--
You received this message because you are subscribed to the Google Groups
"Google Web Toolkit" group.
To view this discussion on the web visit
https://groups.google.com/d/msg/google-web-toolkit/-/PXOdel8GqfkJ.
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.