-
Notifications
You must be signed in to change notification settings - Fork 4.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Address regressions from previous formatting changes
- 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).
- Loading branch information
1 parent
1a3c5d2
commit b593d86
Showing
16 changed files
with
644 additions
and
569 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.