-
Notifications
You must be signed in to change notification settings - Fork 493
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
fix minor regression in txnMerkleToRaw #3608
fix minor regression in txnMerkleToRaw #3608
Conversation
…orand/go-algorand into feature/dilithium-scheme-integration
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 looks good. Am I understanding properly that the big win came from not needing to build slices, and instead passing the digests as arrays? Maybe that then allowed the copy loop to be unrolled because the size was hardcoded?
The fact that the size is fixed ( hence no slice ), makes it simpler for the copy, since there is no risk of "overlapping". As for the wins in avoiding building a slice : that's also true. The size of a slice is 24 bytes. The size of the digest is 32 bytes. so, the outcome might have been different for bigger slices. For 32 byte slices, passing it as an array seems to perform better. disabling the function inlining using //go:noinline
func txnMerkleToRawAppend ... gave the following results:
I believe that the slowness in the |
Codecov Report
@@ Coverage Diff @@
## feature/dilithium-scheme-integration #3608 +/- ##
========================================================================
- Coverage 48.07% 48.06% -0.02%
========================================================================
Files 381 381
Lines 62061 62061
========================================================================
- Hits 29836 29827 -9
- Misses 28807 28814 +7
- Partials 3418 3420 +2
Continue to review full report at Codecov.
|
Summary
My previous PR was causing a minor regression. Thanks to @jannotti comment, I think that I was able to fix the regression, and added a proper testing for that.
Test Plan
New benchmark result ( no inner method anymore )