-
Notifications
You must be signed in to change notification settings - Fork 2.7k
[WIP] Moving the UTF8 Parser/Formatter code into System.Private.CoreLib #20873
Conversation
CC. @danmosemsft, @GrabYourPitchforks, @jkotas, @stephentoub I'd appreciate some input on this, and if it is a direction we would like to persue. If not, it might be good if we could come up with an alternative for sharing the code (where possible). |
Sounds good to me. |
Hmmm.
|
@tannergooding, does this help/hurt the throughput of operations like |
Still need to check, but I wouldn't expect it to. We were already only dealing with ASCII characters (once we got it into a NumberBuffer) and most of the parsing code was already casting back and forth from |
@@ -0,0 +1,174 @@ | |||
// Licensed to the .NET Foundation under one or more agreements. |
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.
Purely a logistical comment, but should we instead do this by moving the code in corefx to shared, letting it mirror over, and then updating the rest of coreclr with the necessary changes? I think that would make the history easier to follow.
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.
That sounds like a good idea.
Closing this and breaking it into multiple PRs:
|
I'm also looking into the JIT assert. |
We generally won't prejit methods that rely on HW intrinsics. |
Today, the UTF8 Parser/Formatter code lives in System.Memory. However, this presents a potential problem with sharing bits of code (namely the Decimal/Double/Single formatters/parsers).
I talked with @GrabYourPitchforks a few times about this and suggested we move the code into
System.Private.CoreLib
. This allows us to readily share the more complicated code and keep the code in sync between the two.NumberBuffer
instance that carries aSpan<byte>
Span<char>
buffer previously used by the UTF16 Parser never contained digits outside0-9
andnull
anyways.NumberToDecimal
,NumberToDouble
, andNumberToSingle
code where possible