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

[NO REVIEW] Trying to isolate a failure #84788

Closed
wants to merge 4 commits into from

Conversation

stephentoub
Copy link
Member

No description provided.

Augments SByte, Byte, Int16, UInt16, Int32, UInt32, Int64, UInt64, IntPtr, UIntPtr, Int128, UInt128, Half, Single, Double, NFloat, and Decimal.

Also fixes corelib TODOs around using IUtf8SpanFormattable.

And removes some duplicate code from Utf8Formatter.

There is still more consolidation to be done between FormattingHelpers and Number.Formatting.
- Use an internal interface implemented by char and byte to have dedicated CastFrom methods that are always inlineable due to very small size.
- Use pointers in some core formatting routines to avoid needing bulky IL for manipulating refs with spans, making various members more inlineable.
- Avoid Encoding.UTF8.GetBytes in various code paths by caching more UTF8 sequences on DateTimeFormatInfo and NumberFormatInfo
- Change FormatCustomizedTimeZone to special-case 2 vs 3+ tokens in order to avoid extra AppendSpan calls
- Fix growth logic in ValueListBuilder to not forcibly grow more than is needed
- Inline ValueListBuilder.AppendSpan and remove some bounds checks (at least on 64-bit)
- Change FormatDigits to special-case lengths of 1/2/4 and to use existing formatting routines rather than a custom one
- Remove the FormatDigits wrapper overload and just have all calls go to the main workhorse method.
- Remove the use of "..."u8 in R/O formatting that leads to needing to use additional span-based helpers.  The minimal gain on coreclr isn't worth the extra complication
- Changed some switches to include half the cases based on lowercasing the ASCII input char
- Moved Date/TimeOnly charsWritten into Try method to be closer to the source of truth rather than having the value far aware (this isn't for perf and could possibly even be a microregression, so I included it here to ensure it's not measurable).
@stephentoub stephentoub added NO-MERGE The PR is not ready for merge yet (see discussion for detailed reasons) NO-REVIEW Experimental/testing PR, do NOT review it labels Apr 13, 2023
@ghost ghost assigned stephentoub Apr 13, 2023
@dotnet-issue-labeler dotnet-issue-labeler bot added needs-area-label An area label is needed to ensure this gets routed to the appropriate area owners new-api-needs-documentation labels Apr 13, 2023
@dotnet-issue-labeler
Copy link

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, 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.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
needs-area-label An area label is needed to ensure this gets routed to the appropriate area owners new-api-needs-documentation NO-MERGE The PR is not ready for merge yet (see discussion for detailed reasons) NO-REVIEW Experimental/testing PR, do NOT review it
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant