Solved

datacontract serialization in WCF

Posted on 2013-12-11
3
430 Views
Last Modified: 2014-03-21
datacontract serialization is faster than xml serialization
 OR
datacontract serialization is 10% faster than xml serialization

One of friend asked me the above question but i have not got any proper answer of the above question. Can you guys explain, what is the reason why datacontract serialization is 10% faster than xml serialization
0
Comment
Question by:dynamicweb09
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 22

Expert Comment

by:p_davis
ID: 39711913
I'm not sure I understand.... Data Contracts serialize into an XML stream or document. So saying that question as a declarative statement is redundant.
0
 
LVL 75

Expert Comment

by:käµfm³d 👽
ID: 39712087
I suspect by "xml serialization" the author means the XmlSerializer.
0
 
LVL 36

Accepted Solution

by:
Miguel Oz earned 500 total points
ID: 39718087
Datacontract serialization is faster than xml serialization because the former is optimized to serialize properties that are identified as data members. XmlSerializer inspects all fields of an object using reflection and implement custom xml serialization (e.g. control of the XML structure)  thus it is slower than Datacontract serialization

Notes: 1) You can not tell how fast because it will depend on your object.
2) For more information see MS guidelines
3) Notice that guidelines recommendations: "AVOID supporting runtime serialization or XML serialization just for general persistence reasons. Prefer data contract serialization instead" and "XML serialization technology has been superseded by the Data Contract Serialization"
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction Hi all and welcome to my first article on Experts Exchange. A while ago, someone asked me if i could do some tutorials on object oriented programming. I decided to do them on C#. Now you may ask me, why's that? Well, one of the re…
Exception Handling is in the core of any application that is able to dignify its name. In this article, I'll guide you through the process of writing a DRY (Don't Repeat Yourself) Exception Handling mechanism, using Aspect Oriented Programming.
This is Part 3 in a 3-part series on Experts Exchange to discuss error handling in VBA code written for Excel. Part 1 of this series discussed basic error handling code using VBA. http://www.experts-exchange.com/videos/1478/Excel-Error-Handlin…
Monitoring a network: why having a policy is the best policy? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the enormous benefits of having a policy-based approach when monitoring medium and large networks. Software utilized in this v…

691 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question