Serialization techniques and comparison
The serialization of business objects is the process in which business objects are converted to data for being then persisted on a storage device (ES: a relational database or an XML file).
DADO Solution® supports different types of serialization, depending on the available implementation an design.
Following benchmark has been done on a business object with 10 properties (of different types, like String, Guid, DateTime, Int32, etc) and comparing the required time to deserialize it 100000 times (creating 100'000 instances of it with data coming from a serialization stream).
Following results have been measured ticks (time in nanoseconds):
| Serialization |
Performance |
| Based on public fields and properties |
~ 40 million ticks |
| Custom serialization (System.Runtime.Serialization.ISerializable) |
~ 28 million ticks |
| Custom serialization (DADO.Serialization.ISerializableEx) |
~ 13 million ticks |
| Custom serialization surrogate |
~ 13 million ticks |
Conclusions
Following benchmarks clearly shows that implementing your own serialization and deserialization (avoiding this way .NET reflection) increase performance of a factor of 3. We highly suggest, in particular in the tuning phase of your projects, to implement such functionalities.
|