-
Notifications
You must be signed in to change notification settings - Fork 5k
Consider using IUtf8SpanParseable
/IUtf8SpanFormattable
in STJ's built-in converters.
#84305
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
Comments
Tagging subscribers to this area: @dotnet/area-system-text-json, @gregsdennis Issue DetailsMinimalAPI benchmark has a It seems that STJ doesn't have a fast-path Lines 60 to 63 in 50c9dca
|
STJ uses bespoke formatting logic in order to support formatting dates directly to UTF-8. I wouldn't be too keen to repeat this for |
Tagging subscribers to this area: @dotnet/area-system-buffers Issue DetailsMinimalAPI benchmark has a It seems that STJ doesn't have a fast-path Lines 60 to 63 in 50c9dca
|
Worth noting we approved
|
#84469 adds IUtf8SpanFormattable to DateOnly. But the time we're done with implementing IUtf8SpanFormattable everywhere that currently implements ISpanFormattable, I expect Utf8Formatter will effectively be obsolete. |
Tagging subscribers to this area: @dotnet/area-system-text-json, @gregsdennis Issue DetailsMinimalAPI benchmark has a It seems that STJ doesn't have a fast-path Lines 60 to 63 in 50c9dca
|
In that case, I'm reassigning this back to STJ and scoping this to adding IUtf8SpanFormattable /IUtf8SpanParseable support in STJ's converters. |
IUtf8SpanParseable
/IUtf8SpanFormattable
in STJ's built-in converters.
Addressed in part by #86931. |
Moving to 9.0, since at this point we'll have less time to react to potential regressions. |
This is definitely something we'd get a lot of use out of. For context we create a lot of custom domain types that convertable to/from strings. We end up using these with JSON a lot, and so it's added friction to need to create JSON converters |
MinimalAPI benchmark has a
DateOnly
field in an object it then serializes to utf8 json.It seems that STJ doesn't have a fast-path
DateOnly -> UTF8
like it has for e.g.DateTime
andDateTimeOffset
. Instead, it doesDateOnly -> UTF16
string and then converts it to Utf8.runtime/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/Converters/Value/DateOnlyConverter.cs
Lines 60 to 63 in 50c9dca
The text was updated successfully, but these errors were encountered: