This folder contains benchmarks of the most popular serializers.
- XML
- XmlSerializer
4.3.0
- XmlSerializer
- JSON
- DataContractJsonSerializer
4.3.0
- Jil
2.17.0
- JSON.NET
12.0.2
- Utf8Json
1.3.7
- DataContractJsonSerializer
- Binary
- BinaryFormatter
4.3.0
- MessagePack
1.7.3.7
- protobuff-net
2.4.0
- BinaryFormatter
Missing: ProtoBuff from Google and BOND from MS
Data Contracts were copied from a real Web App - allReady to mimic real world scenarios.
- LoginViewModel - class, 3 properties
- Location - class, 9 properties
- IndexViewModel - class, nested class + list of 20 Events (8 properties each)
- MyEventsListerViewModel - class, 3 lists of complex types, each type contains another list of complex types
- We want to compare "apples to apples", so the benchmarks are divided into few groups:
ToStream
,FromStream
,ToString
,FromString
. - Stream benchmarks write to pre-allocated MemoryStream, so the allocated bytes columns include only the cost of serialization.