locked
Syncing to mobile device via WCF web service SLOW, Serialization? RRS feed

  • Question

  • I have a WCF interface that exposes the Sync relationship between SQL Compact-based Windows Mobile devices and a SQL 2008 database. It was an ordeal to get that setup. To further my punishment and in a vain attempt to speed up the device's sync times, I also added GZIP compression to the mix.

     

    The bandwidth has gone down with the addition of GZIP, but my sync times are as slow as ever. Much searching has pointed the finger at the XMLSerializer and the massive amount of memory and CPU time it takes to serialize and deserialize data to and from the web service.

     

    I spent most of the day trying to get various binary serializers working; I'm not smart enough (or interested enough) to do so myself, so I've been spending time copying and modifying the work of others. Initially the most promising were Mahjayar's post on Improving Memory Performance in WCF Based Synchronization:

     

    http://blogs.msdn.com/mahjayar/archive/2008/10/01/dbsyncprovider-improving-memory-performance-in-wcf-based-synchronization.aspx

     

    and Peter Bromberg's code detailed in his article, Compressed Binary Dataset Serialization for Compact Framework:

     

    http://www.eggheadcafe.com/articles/20040311.asp

     

    Unfortunately, Mahjayar makes the mistake that many online writers do: they reference a problem and then provide a high level theoretical solution. High level theories need not apply in this game. This is an extremely fickle beast: WCF, Sync Services, Windows Mobile and the Compact Framework, compression - at the best of times these things barely work together. Bloggers, for futuer reference: If you're going to proclaim expertise, then providing a running code sample would cement your position nicely.

     

    So, (1) can somebody at MS tell me if I'm on the right path and if so can you point me at a real code sample where somebody has replaced the slow serializer with a fast one to serialize the sync service classes? and (2) tell me if I should get off the path because you're about to release an update that fixes terribly slow deserialization in the Compact Framework?

     

    Thanks

    Shane

    • Moved by Hengzhe Li Friday, April 22, 2011 2:53 AM (From:SyncFx - Microsoft Sync Framework Database Providers [ReadOnly])
    Wednesday, December 3, 2008 3:57 AM

Answers

  • We are keenly aware of this issue and consider it one of our top priorities.  We recognize that we need to put together a sample demonstrating the perf gains that might be realized using serialization.  This work item is on the books for vNext although I cannot provide a hard date at this time which is no help to you.  The SQL Compact team has also put together a prototype of a version of the Compact provider that leverages SqlCEResultSet which improves insert performance drastically.  I meet with them next week to determine the appropriate ship vehicle for these changes.  Again, I do not have hard dates yet but know that we recognize that this is a huge gap in our current product offering and will make efforts to address this gap.

     

    Regards,

     

    Sean Kelley

    Program Manager

    Sean Kelley

     

     

     

     

    Monday, January 12, 2009 10:18 PM
    Moderator

All replies

  • Monday, December 8, 2008 12:05 PM
  • Thanks for the reference. Yes I had reviewed that article and attempted various suggestions therein. Nothing there changes the fact that serialization and deserialization is slow when you're dealing with thousands of records on the Compact Framework.

     

    I'm still looking for somebody to suggest a way around slow serialization in the compact framework.

     

    Thanks

    Shane

    Monday, December 8, 2008 7:39 PM
  • Is there anybody out there on the MS side of things who would like to take a stab at this? This is a paralytic situation. With this kind of problem in place it makes it impossible to use sync services via a serialized service call in a mobile environment where thousands of rows of data are involved. Nobody's saying that a PDA should be able to load, query or work with 20 million rows of data, but five or ten thousand? Seems like a pretty low bar. As long as the real world performance threshold remains so low, sync services in a mobile environment is DOA.

     

    Tuesday, December 16, 2008 2:41 AM
  • Anyone from MS support inclined to comment? There have been whispers that MS is keenly aware of this shortcoming and that it is a priority for the "next release". Am I holding my breath for nothing?

    Thursday, January 8, 2009 9:05 PM
  • We are keenly aware of this issue and consider it one of our top priorities.  We recognize that we need to put together a sample demonstrating the perf gains that might be realized using serialization.  This work item is on the books for vNext although I cannot provide a hard date at this time which is no help to you.  The SQL Compact team has also put together a prototype of a version of the Compact provider that leverages SqlCEResultSet which improves insert performance drastically.  I meet with them next week to determine the appropriate ship vehicle for these changes.  Again, I do not have hard dates yet but know that we recognize that this is a huge gap in our current product offering and will make efforts to address this gap.

     

    Regards,

     

    Sean Kelley

    Program Manager

    Sean Kelley

     

     

     

     

    Monday, January 12, 2009 10:18 PM
    Moderator
  • Sean - thank you so much. It is now one month since your post and I'm wondering if you have any clearer guidance on ship dates for either the samples in question or the next release.
    Tuesday, February 10, 2009 3:08 PM
  • -- bump --

    Can anyone at MS offer guidance on a release date for code that addresses the serialization issues? It has been promised on these forums since at least August of last year.
    Tuesday, March 3, 2009 4:31 AM
  • Sean, can you please give an update on this issue.

    We are planning to move all our data synchronization from SQL Merge Replication to Sync Services, but the above problem would definately be a show stopper since all our clients are running Windows Mobile / SQL Server Compact and have at least 40-50.000 rows of data.

    /Anders
    Anders Heick | Software Architect | HandStep
    Wednesday, June 24, 2009 1:54 PM
  • Oh yes. This question would interest me too.
    Is it already done in the current new Release?
    Wednesday, June 24, 2009 4:09 PM