Applied BinaryPrimitives throughout CoreLib#37582
Merged
GrabYourPitchforks merged 5 commits intodotnet:masterfrom Aug 14, 2020
Merged
Applied BinaryPrimitives throughout CoreLib#37582GrabYourPitchforks merged 5 commits intodotnet:masterfrom
GrabYourPitchforks merged 5 commits intodotnet:masterfrom
Conversation
d5c3f7e to
688e454
Compare
Contributor
Author
|
I've added a few more such instances in Guid.cs and Decimal.cs |
GrabYourPitchforks
approved these changes
Aug 14, 2020
Member
|
CI is having trouble kicking off, but the previous run (pre-conflict resolution) was green. So we're good to go. |
This file contains hidden or 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
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR removes manually writing individual bytes of 64 bit data types (
long,ulong,double) into the _buffer array and replaces it with a singleBinaryPrimitivescall yielding about9%better performance.I've benchmarked changes of < 64 bit types to
BinaryPrimitivescalls, but found performance regression, hence their implementation is unchanged.There is also an unnecessary write to the _buffer array to convert a bool to a byte. This was replaced with a direct call to
WriteByte()of Stream improving performance by about55%.New: