XStream Major Performance issues

Put your problem here if it does not fit any of the other categories.

XStream Major Performance issues

Postby MaximG » Sat May 23, 2009 12:28 pm

Hello All,
I was hoping someone would be kind enough to help me with some performance issues I have been experiencing using XStream on the Android platform.

Unmarshalling some basic XML objects takes approximately 3.25 SECONDS. (And I have read people on this forum complaining about 8ms unmarshalling times.)

Let me first provide an example:

I have a basic CategoriesList which is an ArrayList OF Categories. It contains the usual properties you would expect - id, description, parentid, sequenceid, imagepath and also contains a ListOF ChildCategories which is also an ArrayList of Categories.

Taking some xml with a list of 5 categories 2 of which have around 4 child categories. So about 13 Category objects; unmarshalling this object takes 3.25 seconds of which 2.8 seconds about (85% of our time) is spent in the line readObjectMethod.invoke(object, new Object[]{stream}); which can be found in the class SerializationMethodInvoker.

Now I have worked out that this "stream" is of a type CustomObjectInputStream which is feeding this reflection invokocation and in the process slowing everything down.

The reason I assume it is the CustomObjectInputStream not the reflective invocation itself is because i have done some testing with reflection on Android and although it is slow this seems extreme compared to my testing.

I have also tested it with some very simple Customer objects (id, firstname, lastname, address, email, username, password) and although faster still takes over a second.

At these sort of times it makes the library unusuable in Android.

Has anyone had any experience using Xstream on Android?
Was anyone able to overcome these problems?
Does anyone have any ideas how I might be able to improve this CustomObjectInputStream?

I came from a .Net background so I have found even getting here daunting.

Any help would be highly appreciated.
MaximG
Freshman
Freshman
 
Posts: 3
Joined: Wed Apr 15, 2009 3:55 am

Top

Postby coolalok » Thu Sep 10, 2009 7:15 am

Hey can you tell me the steps of including the jar files of Xstream in eclipse so that i can use them to serialise deserialise json objects.
Android......
Here I come!!!
User avatar
coolalok
Developer
Developer
 
Posts: 29
Joined: Tue Sep 01, 2009 7:35 pm
Location: Pune,India

Re: XStream Major Performance issues

Postby ExxKA » Sat Nov 07, 2009 12:30 am

MaximG wrote:At these sort of times it makes the library unusuable in Android.

Has anyone had any experience using Xstream on Android?
Was anyone able to overcome these problems?
Does anyone have any ideas how I might be able to improve this CustomObjectInputStream?


Hey MaximG.

As of this moment I am looking into XStream, I am of course considering using it in my own project. Did you ever overcome your performance issues?

Oh, and coolalok, please don't derail the topic, start another thread.
ExxKA
Developer
Developer
 
Posts: 29
Joined: Tue Nov 03, 2009 7:16 pm
Location: Denmark

Postby ExxKA » Sun Nov 08, 2009 5:28 pm

Of course I lost the link by now, but I have seen much better performance times at another post, and when I tested XStream myself it was very snappy. But of course you should consider how much overhead you are adding to your application instead of just serializing your objects manually, which is the approach I have landed on.

Then reason why I am not using XStream is that the android compiler issues a bunch of warnings.
ExxKA
Developer
Developer
 
Posts: 29
Joined: Tue Nov 03, 2009 7:16 pm
Location: Denmark

Top

Return to Other Coding-Problems

Who is online

Users browsing this forum: No registered users and 19 guests