WCF client slow to start—if using DataContractSerializer, does XmlSerializer pre-gen help? RRS feed

  • Question

  • I'm seemingly not alone in suffering poor performance in a WCF client's first call to a WCF service, but I'm not clear on whether one of the frequently-cited fixes for this is appropriate in my situation.
    Many forum responses and blog posts I've run across link to "How to: Improve the Startup Time of WCF Client Applications using the XmlSerializer" here:

    That article is a bit light on instructions for what to do once you've generated a [MyService].XmlSerializers.cs file.  But I'm even more lost because I apparently cannot use the XmlSerializer on my service anyway, since a few methods return Dictionary objects.  That's fine--I chose much earlier to use DataContractSerializer, so on the service side I've got my [DataContract] decorators and so forth in place.

    But if I'm committed to using DataContractSerializer instead of XmlSerializer, does that mean I don't have a way of pre-generating the serialization code on the client side? If generating that serialization code at runtime is partly to blame for our performance woes, would I have been better off using XmlSerializer?

    • Edited by Sean Mahan Monday, February 25, 2013 8:28 PM
    Monday, February 25, 2013 8:28 PM