Solved

datacontract serialization in WCF

Posted on 2013-12-11
3
420 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 35

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

ScreenConnect 6.0 Free Trial

Check out the updates in one game-changing release, ScreenConnect 6.0, based on partner feedback. New features include a redesigned UI that improves session organization and overall user experience. See the enhancements for yourself!

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…
Entity Framework is a powerful tool to help you interact with the DataBase but still doesn't help much when we have a Stored Procedure that returns more than one resultset. The solution takes some of out-of-the-box thinking; read on!
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…
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…

832 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