Solved

datacontract serialization in WCF

Posted on 2013-12-11
3
422 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
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: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say 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

What my article will show is if you ever had to do processing to a listbox without being able to just select all the items in it. My software Visual Studio 2008 crystal report v11 My issue was I wanted to add crystal report to a form and show…
While working on Silverlight and WCF application, I faced one issue where fault exception occurred at WCF operation contract is not getting propagated to Silverlight client. So after searching net I came to know that it was behavior by default for s…
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…
Attackers love to prey on accounts that have privileges. Reducing privileged accounts and protecting privileged accounts therefore is paramount. Users, groups, and service accounts need to be protected to help protect the entire Active Directory …

713 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