-
Notifications
You must be signed in to change notification settings - Fork 272
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add System.Text.Json to JSON serializer benchmarks #2740
Add System.Text.Json to JSON serializer benchmarks #2740
Conversation
<!-- this repo needs to build with netcoreapp3.1, so we can't use latest C# syntax --> | ||
<LangVersion>8.0</LangVersion> | ||
<EnableXlfLocalization>false</EnableXlfLocalization> | ||
<LangVersion>9.0</LangVersion> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note that source gen requires C# 9 since it is setting init-only properties. I've conditioned the lang version on the target framework as it seemed like the smallest possible fix, but I defer to maintainers on the right approach.
cc @adamsitnik
40a9e3d
to
45e6a44
Compare
@eiriktsarpalis currently this repo has no CI leg to verify that 3.1, 6.0 and 7.0 builds are still working. I've created #2732 to address that. Once I get it merged (somewhen next week), I am going to review this PR and merge it too. |
FWIW I have checked locally and it compiles for all TFMs. Given that 3.1 is going out of support next month, perhaps we could just remove support for it altogether? We can then use a consistent language version for all TFMs. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Overall it looks good to me. Please take a look at my comments before merging the PR.
Thank you for adding more benchmarks @eiriktsarpalis !
Co-authored-by: Adam Sitnik <[email protected]>
Co-authored-by: Adam Sitnik <[email protected]>
Adds System.Text.Json (reflection & source gen) to the benchmark suite comparing .NET JSON serializers. Here's a few representative results using
IndexViewModel
values:String Serialization
String Deserialization
Stream Serialization
Stream Deserialization
Fix dotnet/runtime#78451.