Mono-software.com
This content has not been rated yet. 
Few days ago I have stumble on a problem reported by a customer saying that communication between client and a server application is slow. So I have take a look what may be causing the problem and found that serialization process is slow, well not that slow as it was creating large amount of data which was sent over the wire. At the end I had to optimize whole process, to do that I had to find .Net serializer that is producing less data. This is a small overview of the available .Net serialization libraries.

Here is a list of serialization libraries that I have tested

BinaryFormatter (.NET Built-in serializer) - this is the serializer we are using at the moment and let's say it is producing around 100kb of data (just for comparison).

DataContractSerializer (.NET Built-in serializer) - Our test has shown that this is a powerful serializer, which will generate a 50% less data then the binary serializer, we didn't test the serialization speed but we have included some speed test links below, and they say this is pretty fast serializer. The downside for this serializer is that you need to know the object type which you want to serialize and deserialize (and the whole object graph to serialize the sub-objects).

NetDataContractSerializer (.NET Built-in serializer)  - If you only trust the .NET serializers then this should be your choice, it will produce almost the same amount of data as the DataContractSerializer (50% less then BinaryFormatter) with the almost the same speed but you don't need to know the object type (object graph). Use it with the BinaryWriter and you should get some great results.
http://blogs.msdn.com/b/rjacobs/archive/2010/04/15/datacontractserializer-vs-netdatacontractserializer.aspx

DataContractJsonSerializer (.NET Built-in serializer)  - JSON version of the DataContractSerializer which is super fast and has a small data footprint but it requires you to know the object graph. 

XmlSerializer (.NET Built-in serializer) - One of the oldest built-in serializers available it is slow and has a big data footprint. You can read more about it here:
http://blogs.msdn.com/b/james_world/archive/2006/09/27/773852.aspx

OpenNxSerialization - Fast and compact serializer which can be used in a same manner as BinaryFormatter. Author claims it is 50 times faster, we didn't get that great results but it was much faster then BinaryFormatter and it was producing 20%-30% less data. A good alternative to BinaryFormatter, you can find out more about the OpenNxSerialization here.

ServiceStackThe fastest and most compact text-based serializer for .NET. A great library if you are looking for alternative for XmlSerializer or DataContractSerializer. Although we didn't get it working in our real-world project, it is very simple to use so we advise you to consider it as serious alternative. You can read more about it here.

ProtoBuf-net - "a language-neutral, platform-neutral, extensible way of serializing structured data for use in communications protocols, data storage, and more." (Ref.) The fastest serializer with the smallest footprint that we have tested. It is Google Protocol Buffers based serializer ported to .NET. It is super fast binary formatter and the data footprint is super small (Compared to BinaryFormatter), it is built upon the Google Protocl Buffer encoding standard that's why it is producing small amount of data. Downside is that he requires you to know the object graph but considering the benefits from this serializer I'll suggest you find a way around that problem. Although it is under heavy development by Mark Gravel (ProtoBuf-net v2) it is an easy to use serializer, and we need to mention that he was more than willing to help us get the v2 up and running.

Summary

These are all great serializers but every serializer has it's own purpose and at the end we have chosen the ProtoBuf-net v2 as our serializer, now we are working on the ProtoBuf-net implementation in our real-world project so we will see how it goes.
I hope this will save you some time while searching for a serialization solution.

Here are some of the helpful links I have found while trying to find the solution for our problem.

Performance overview 
Comparing the Performance of .NET Serializers

A small serialization speed overview (ServiceStack performed wide range of speed test that can be found here)
Serializer Payload size Larger than best Serialization Deserialization Total Avg per iteration Slower than best
Microsoft DataContractSerializer 4097 4.68x 235392060 643889088 879281148 879.2811 6.72x
Microsoft JsonDataContractSerializer 1958 2.24x 400010575 932212071 1332222646 1332.2226 10.18x
Microsoft BinaryFormatter 4927 5.62x 622288868 563079698 1185368566 1185.3686 9.06x
NewtonSoft.Json 2014 2.30x 303865396 763206254 1067071650 1067.0716 8.15x
ProtoBuf.net 876 1x 64480719 66410737 130891456 130.8915 1x
ServiceStack TypeSerializer 1560 1.78x 152435512 98672475 251107987 251.1080 1.92x
Good utility (technique) to help you detect the unknown types when using XMLSerializer and alike.
Serializable Extra Types for .NET 4
Notify me when new comments are added to this post