Skip to content
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

perf: optimize "msb" by using assembly #135

Merged
merged 1 commit into from
Nov 28, 2022
Merged

Conversation

PaulRBerg
Copy link
Owner

Re-implements #133 on top of the staging branch.

Thanks again for your contribution @t4sk. I made sure that you remain a git author by modifying the git commit body and referencing you there, like this:

Co-authored-by: t4sk <[email protected]>

Also, for the record, I made a few changes to your implementation:

  • Updated the function's NatSpec documentation to explain how the new implementation works
  • Added comments above each assembly block to give a hint to the user about what power of two factor is being checked
  • Renamed f to factor (though please correct me if this stands for something else)
  • Swapped the order of the x and result assignment statements in each assembly blocks

@PaulRBerg PaulRBerg merged commit bad6ba8 into staging Nov 28, 2022
@PaulRBerg PaulRBerg deleted the perf/optimize-msb branch November 28, 2022 15:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant