Skip to content

Alois-xx/SerializerTests

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

SerializerTests

.NET Serializer testing framework

This test framework compares the most popular and fastest serializers for .NET which was the input for

The project compiles to .NET 7, .NET 6, .NET 5, .NET Core 3.1 and .NET 4.8 where you can check out the serialization performance in your favorite .NET Framework. To compile the solution you need Visual Studio 2022 17.4 or later and the corresponding .NET SDKs and .NET 4.8 installed .

The currently tested Serializers are

The test suite tries its best to be fair and vendor neutral. More than one serializer claims to be the fastest. Now you can test at your own if that is really the case. If I have forgot a great serializer (should be as fast or faster than Protobuf) please drop me a note and I will include it.

Legacy Serializers

These are either no longer compatible with .NET Core 3.1 .NET 5.0 or were superseded by newer ones. Were possible I have commented out only the serializer invocations in Program.cs so you can add them again if you are curious.

Running

  • Clone Repo
  • Build Release
  • Execute RunAll.cmd from source directory

You will get a combined CSV file for all tested serializers on your machine for .NET 7, .NET 6, .NET 5, .NET Core 3.1 and .NET 4.8. Then you can verify the data yourself. If you want to plug in your own data types see Program.cs how to extend/modify the test suite.

Profiling

Execute RunAll.cmd -profile from source directory after compiling. This uses WPR with MultiProfile.wprp from FileWriter. WPR is taken from the Windows 10 SDK which needs to have installed the Windows Performance Toolkit from the Windows SDK first. You can use your current WPR of Windows which may work but you need to change the WPR location in Profile.cmd. Besides the CSV files are then the ETL files stored which you can then analyze further with WPA or ETWAnalyzer.

  • SerializeTestsNet48.etl
  • SerializeTestsNet31.etl
  • SerializeTestsNet50.etl
  • SerializeTestsNet60.etl
  • SerializeTestsNet70.etl

When you overwrite the Special.stacktags of ETWAnalyzer with the one from SerializerTests like

copy D:\Source\git\SerializerTests\SerializerStack.stacktags D:\Utils\ETWAnalyzer\Configuration\Special.stacktags 

Then extract the data in the folder where the ETL files were generated

ETWAnalyzer -extract all -fd D:\Source\git\SerializerTests\SerializerTestResults\_8_51_33 -symserver MS

you get nice query capabilities which makes it easy to compare things accross .NET versions or machines.

alt text

About

.NET Serializer testing framework

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published