-
Notifications
You must be signed in to change notification settings - Fork 5.2k
[MONO] Partially revert "Clean up in Number.Formatting.cs (#110955)" #118499
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
Conversation
This reverts commit 4020e05.
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.
Pull Request Overview
This PR partially reverts performance regression introduced in PR #110955 that affected Mono runtime significantly. The changes revert optimizations in number formatting that used ReadOnlySpan<byte>
properties back to static readonly byte arrays to restore performance.
- Reverts
TwoDigitsCharsAsBytes
andTwoDigitsBytes
fromReadOnlySpan<byte>
properties back tostatic readonly byte[]
fields - Updates references from
MemoryMarshal.GetReference
toMemoryMarshal.GetArrayDataReference
to match the reverted field types - Adds
.ToArray()
calls to convert the concatenated UTF-8 string literals back to byte arrays
PTAL @stephentoub @lewing |
I expect that the rewrite would have to be ifdefed out for Mono as well, to avoid introducing even worse perf regression. |
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.
approving for wasm/mono since this we see this in key scenarios, I'm fine with an ifdef if that is preferred.
Added if-defs, PTAL @jkotas |
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.
Thanks! LGTM. I assume that this is zero-diff change for CoreCLR and NAOT.
/ba-g coreclr android timeouts are known and resolved on the tip of main |
Some changes in #110955 PR regressed Mono runtime significantly (>150 benchmarks) given number formatting is often a perf sensitive area I'm reverting that change for now, we'll figure out it later in 11.