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>
, whereX
is inherited by multiple other objects, so that the list contains many different types at runtime? (I was told thatDataContractSerializer
can be givenKnownTypes
attributes, but this means more dependencies in the code. Is there a way to makeDataContractSerializer
know all that types in my solution?)
Thanks.