views:

54

answers:

2

I am attempting to use Restlet for Android to query an OData data source. However, I am not impressed with its performance in both the emulator as well on a real device. I have the requests made in a wrapper AsyncTask to make the UI responsive but it still takes over 1 minute to finally return the objects.

I get plenty of these in the LogCat window:

10-04 18:20:41.667: DEBUG/dalvikvm(278): GC freed 7872 objects / 523928 bytes in 279ms

What can I do to speed up the queries?

A: 

I know this doesn't help you with the perf of the RESTlet library... but:

One thing to consider is using something called Service Driven Paging. Note this is distinct from $top and $skip (aka client driven paging), because the server pages even if the client doesn't ask for it.

SDP is particularly useful when a client does an unfiltered query over a large data set.

That way perhaps you can lower that 7872 number to something more manageable.

Alex James
I am currently using this. The 7872 number is a mystery to me.
Daniel A. White
A: 

Check out odata4j - http://odata4j.org This is an alternative odata library for java, including an android-compatible client api.

We just released a simple android client example in our 0.3 release. This example demonstrates an efficient way of parsing/paging an arbitrary odata service.

Along with service driven paging (mentioned by Alex), we use the efficient xml pull parser implementation to parse the odata payload (we found heap activity/GCs to be the biggest perf bottleneck on android).

John Spurlock