Skip to content

perf: optimize "msb" by using assembly#135

Merged
PaulRBerg merged 1 commit intostagingfrom
perf/optimize-msb
Nov 28, 2022
Merged

perf: optimize "msb" by using assembly#135
PaulRBerg merged 1 commit intostagingfrom
perf/optimize-msb

Conversation

@PaulRBerg
Copy link
Copy Markdown
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 <tsk.nakamura@gmail.com>

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
Co-authored-by: t4sk <tsk.nakamura@gmail.com>
@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

1 participant