Binary vs. xml serialization performance

Toshiba Tecra M5 (dual 2Ghz processor, 2Gb memory) an object of type List<object[]> containing 296 “rows” and 18 “columns” with elements of different data types (strings, integers, dates, etc.) takes approximately 14 ms per iteration for binary serialization & de-serialization and 31 ms per iteration for xml serialization & de-serialization.

Summary:  My tests show that, on average, xml serialization is roughly twice that of binary serialization (i.e. binary serialization takes half the time compared to xml serialization).  

Note:  Serialization performance depends on the complexity of the object, so you should do your own tests to get more precise results for your situation

 

Here is the code I used

 

 

Leave a comment