-
Notifications
You must be signed in to change notification settings - Fork 523
Conversation
Shift8Idenitity should probably be Shift8Identity |
PRing a variant of this to coreclr dotnet/coreclr#8969 as then will effect all serialization (json, mvc etc) |
@@ -1214,6 +1214,71 @@ public void TestGetAsciiStringEscaped(string input, string expected, int maxChar | |||
} | |||
} | |||
|
|||
[Fact] | |||
public unsafe void TestCopyFromAscii() |
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.
I'd like to see some boundary testing here, since you're copying 8 bytes at a time and then whatever is left.
@@ -21,6 +21,9 @@ public struct MemoryPoolIterator | |||
0x02ul << 40 | | |||
0x01ul << 48 ) + 1; | |||
|
|||
const int Shift16Shift24 = 256 * 256 * 256 + 256 * 256; | |||
const int Shift8Idenitity = 256 + 1; |
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.
As pointed out my @mharthoorn, Shift8Identity
.
4853a98
to
177e7d9
Compare
Rebased + sp Need to add boundary testing |
Added large boundary test range; shared parsing between single and multi block; added 64/32 bit split and alignment processing. Probably need to rebench |
Copy ulong per loop, less variables, split multiblock into own path
773b3f9
to
66f7549
Compare
Added benchmarks Before
After
|
9388305
to
ed66e0e
Compare
@@ -21,9 +21,6 @@ public struct MemoryPoolIterator | |||
0x02ul << 40 | | |||
0x01ul << 48 ) + 1; | |||
|
|||
const int Shift16Shift24 = 256 * 256 * 256 + 256 * 256; |
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.
Copy
ulong
per loop, less variable comparison, less variable changes, split multiblock into own pathBefore
After
Also added test for the function...