Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6740827
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T11:39:10+00:00 2026-05-26T11:39:10+00:00

We have an application with objects that we’d like to keep serialized in the

  • 0

We have an application with objects that we’d like to keep serialized in the database.
Currently we’re using NetDataContractSerializer, but recently found out that due to the .Net types information involved, it creates huge files which means slow application, even for basic objects.
We’re considering switching to DataContractSerializer instead, and I’ve been looking for a nice comparison of the two but didn’t find one.

  • What’s the difference in sizes between the objects created by the two?
  • Is there a big performance difference?
  • Is any of them problematic when I have an object that contains a List<X>, where X is inherited by multiple other objects, so that the list contains many different types at runtime? (I was told that DataContractSerializer can be given KnownTypes attributes, but this means more dependencies in the code. Is there a way to make DataContractSerializer know all that types in my solution?)

Thanks.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T11:39:11+00:00Added an answer on May 26, 2026 at 11:39 am
    1. NetDataContractSerializer (NetDCS) writes the type information for all objects, while the DataContractSerializer (DCS) only writes those which need to (i.e., if you declare a member as type B, and the actual value of the member when being serialized is of type D, where D is a derived type from B, so there is a lot less “noise” in a DCS-serialized type.
    2. Not really, but you should try both with your scenario to see if it will affect you
    3. You need to use known types in the DCS, but you can use a DataContractResolver if you don’t want to work with known types. An example of such a resolver can be found in Youssef Massaoui’s blog, and some more information on the resolver itself can be found at my post on WCF extensibility at http://blogs.msdn.com/b/carlosfigueira/archive/2011/09/21/wcf-extensibility-data-contract-resolver.aspx.
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have an application that has several objects (about 50 so far, but growing).
I have a web application that adds contextual information to XmlHttpRequest objects using the
I have a few objects that represent a web application. Currently I have a
I'm currently maintaining an application and noticed that many of the objects that have
I have an application that has many different types of objects that each persist
We have an application that performs comparisons on data objects to determine if one
I have an application that uses Hibernate for its domain objects. One part of
I have an application that creates, and destroys thousands of objects. Is it worth
My application receives strings that represent objects. I have to parse the strings to
I have a factory that builds the objects with longest lifetime in my application.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.