Increase performance of CSLA.Net using XML Web Services

Increase performance of CSLA.Net using XML Web Services

Old forum URL: forums.lhotka.net/forums/t/8694.aspx


Arno1978 posted on Friday, March 19, 2010

Hi

I am rather new to CSLA.Net , but would like some pointers on how to speed up the processing of a CSLA.Net Business Object when sending it over HTTP using a XML Web Service.

We are sending these Business Objects to a Windows Mobile 5 platform running a compact framework 3.5  platform. The time it takes to get from and to the server is very long, between 15 - 25 seconds for each call, which we cannot accep.

We are running CSLA.Net for Windows version 3.7.1

Thanks

Arno Janse van Rensubrg

RockfordLhotka replied on Friday, March 19, 2010

Have you done basic profiling so you know where the time is being consumed? Options include:

  1. Database interaction
  2. Loading the business objects with data
  3. Moving the business objects from the app server to the web server (if you are using a 3-tier deployment with a remote data portal)
  4. Copying the business object properties into your data contract objects
  5. Serialization of the data contract objects by asmx or WCF
  6. Transport of the XML over the network to the device
  7. Deserialization of the XML on the device
  8. Copying of the data from the client-side data contract objects into your client-side business objects or UI
  9. Loading the UI with the data

The most likely candidate is number 6. XML can make even a small amount of data into a very large byte stream, and if this is going over something like a GPRS cell network it could be quite slow.

The next most likely candidate is 8 or 9. Most devices have relatively slow processing, and loading any substantial amount of data into the UI can be slow.

The next most likely candidate is 7 - again due to the processing on the device, and the fact that string manipulation (deserialization of XML is all string manipulation) is one of the slowest computational operations you can perform.

Of course it is possible that you have a bug in steps 2-4 that is causing an issue, or that your database is overloaded which would make step 1 slow. But these are generally less likely that the other options.

Arno1978 replied on Monday, March 22, 2010

Good morning,

I indeed proved that the slow performance is caused by number 5,6, 7 and 8. The process of serialization up to the time when I populate the UI with the data takes between 14 - 25 seconds.

I tried to apply compression for the web service methods, but I am loosing data as soon as I try to compress the data.

Do you perhaps know of any other way to speed up the serialization / serialization process?

Regards,

Arno

RockfordLhotka replied on Tuesday, March 23, 2010

It is good that you've narrowed the problem so you know where to focus, ruling out data access and CSLA.

Unfortunately I personally know essentially nothing about Windows Mobile and what kind of support it has for making service calls and optimizing the data on the wire. Other people on the forum may have done more with WinMo.

Arno1978 replied on Tuesday, March 23, 2010

Thanks for the feedback.

Anybody else got some ideas to maybe successfully compress these web service methods without loosing data?

Please...Big Smile

 

Copyright (c) Marimer LLC