-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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
Clean up in Number.Formatting.cs #110955
base: main
Are you sure you want to change the base?
Clean up in Number.Formatting.cs #110955
Conversation
Tagging subscribers to this area: @dotnet/area-system-numerics |
This comment was marked as resolved.
This comment was marked as resolved.
@@ -1579,7 +1572,7 @@ internal static unsafe void WriteTwoDigits<TChar>(uint value, TChar* ptr) where | |||
|
|||
Unsafe.CopyBlockUnaligned( |
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.
This is basically just doing span.CopyTo, right?
Is the codegen significantly different if we switch to the safe version? Should we log an issue if there's some places that can't be constant folded down here?
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.
@tannergooding yep, that was my initial intent, but looks like for that we need to change too many methods from TChar*
to Span
in Number.Formatting. My initial attempt to do so had a terrible perf impact so I decided to file a general clean up first.
Should we log an issue
I guess we can specifically for this, but it all part of the general issue #94941
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.
The suggestion of logging an issue was mainly for the consideration of if Span.CopyTo
was slower than Unsafe.CopyBlockUnaligned
, no need for an issue to track the switch to using Span in general I don't think
Is it worth doing new Span(ptr, length).CopyTo(dest, length)
in the meantime which should get us slightly better and then we can track the switch to use span everywhere separately?
No description provided.