perf: Implement DecimalEncoder that used 256-bit math to encode decimal values to the avro binary representation#366
Open
PauloHMattos wants to merge 1 commit intoch-robinson:mainfrom
Conversation
…al values to the avro binary representation
70e9c36 to
5a5513a
Compare
Contributor
Author
|
This code code be simplified a lot (and maybe even have a better performance) by using something like https://github.com/NethermindEth/int256 I decided against it to avoid adding a new dependency |
Contributor
Author
|
If the target framework of the library was updated to net8.0 this could be simplified by using UInt128 and maybe vectorized using the new cross-platform Vector128/Vector256 (both introduced in net7.0) |
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 join this conversation on GitHub.
Already have an account?
Sign in to comment
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 is something I had on my fork because my application primarily works with decimal for its numbers.
My objective was to reduce the allocations associated with the use of BigInteger to encode the decimal values, but the change also had a positive impact in throuput.
I don't know, if the extra complexity of this change is worth to take, but decided to open the PR anyway, in case you think it is.
Benchmark code: