Solved

datacontract serialization in WCF

Posted on 2013-12-11
3
406 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
Comment Utility
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 74

Expert Comment

by:käµfm³d 👽
Comment Utility
I suspect by "xml serialization" the author means the XmlSerializer.
0
 
LVL 35

Accepted Solution

by:
Miguel Oz earned 500 total points
Comment Utility
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

What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
Parse CSS value with RegEx 2 39
Dialogbox API leak? 18 59
C# Update Status Bar.... 1 22
bulid json format 3 16
Here I am going to explain creating proxies at runtime for WCF Service. So basically we use to generate proxies using Add Service Reference and then giving the Url of the WCF service then generate proxy files at client side. Ok, what if something ge…
Calculating holidays and working days is a function that is often needed yet it is not one found within the Framework. This article presents one approach to building a working-day calculator for use in .NET.
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…
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.

772 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

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now