Skip to content
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 JsonNumberHandling(Attribute) & support for (de)serializing numbers from/to string #39363

Merged
merged 4 commits into from
Jul 21, 2020

Conversation

layomia
Copy link
Contributor

@layomia layomia commented Jul 15, 2020

Fixes #30255.

@layomia layomia added this to the 5.0.0 milestone Jul 15, 2020
@layomia layomia self-assigned this Jul 15, 2020
@Dotnet-GitSync-Bot
Copy link
Collaborator

Note regarding the new-api-needs-documentation label:

This serves as a reminder for when your PR is modifying a ref *.cs file and adding/modifying public APIs, to please make sure the API implementation in the src *.cs file is documented with triple slash comments, so the PR reviewers can sign off that change.

@layomia layomia force-pushed the json_number branch 3 times, most recently from bfb01c9 to 29d317f Compare July 15, 2020 17:20
@layomia layomia changed the title Add JsonNumberHandling & support for (de)serializing numbers from/to string Add JsonNumberHandling(Attribute) & support for (de)serializing numbers from/to string Jul 19, 2020
@layomia layomia force-pushed the json_number branch 6 times, most recently from 51b8044 to 3b90de7 Compare July 20, 2020 08:47
Copy link
Member

@steveharter steveharter left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

From other pending changes per offline review, LGTM.

@layomia
Copy link
Contributor Author

layomia commented Jul 21, 2020

Barring benchmark noise, there are no noticeable perf regressions caused by this PR:

dotnet run --base D:\benchmarks\numbers\master --diff D:\benchmarks\numbers\feature --threshold 2%
summary:
better: 4, geomean: 1.039
worse: 4, geomean: 1.034
total diff: 8
Slower diff/base Base Median (ns) Diff Median (ns) Modality
System.Text.Json.Serialization.Tests.ReadJson.DeserializeFromUtf8Bytes 1.04 81.42 85.00
System.Text.Json.Serialization.Tests.WriteJson.SerializeToUtf8Bytes 1.04 15760.37 16318.96
System.Text.Json.Serialization.Tests.WriteJson.SerializeToUtf8By 1.03 318.62 328.68
System.Text.Json.Serialization.Tests.WriteJson.SerializeToUtf8Bytes 1.03 120.47 123.72
Faster base/diff Base Median (ns) Diff Median (ns) Modality
System.Text.Json.Serialization.Tests.WriteJson.SerializeToUtf8Bytes 1.04 416.34 400.33
System.Text.Json.Serialization.Tests.WriteJson.Serializ 1.04 462715.53 445168.06
System.Text.Json.Serialization.Tests.WriteJson.SerializeToUtf8Bytes 1.04 808.07 778.40
System.Text.Json.Serialization.Tests.ReadJson.Deseri 1.04 304.35 293.22

feature.zip
master.zip

Jacksondr5 pushed a commit to Jacksondr5/runtime that referenced this pull request Aug 10, 2020
…rs from/to string (dotnet#39363)

* Add JsonNumberHandling & support for (de)serializing numbers from/to string

* Add JsonNumberHandlingAttribute

* Address review feedback + fixups

* Address review feedback ii
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

System.Text.Json: (De)serialization support for quoted numbers
5 participants