-
Notifications
You must be signed in to change notification settings - Fork 44
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
Memory copy loop optimization #2
Comments
Alternatively, if one really wants to keep the data in memory, one can use the identity precompile to copy from memory to memory. It should be cheaper if that loop runs more than 2 times (please check). |
Yep, I see method is internal and argument is not calldata, then really consider using “identity” precompile for copying |
If that loop is replaced, copyPtr and dataPtr both need to be increased still, right? And I think counter needs to be decreased, too. Otherwise mask will be wrong |
this looks great. any thoughts on integrating @wighawag ? |
Implemented this optimization using the identity precompile on this fork in case anyone's interested: RollaProject@3cef7ae @z0r0z @wighawag Please let me know if a PR with this change would be welcome :) |
How much did deploy and call costs change with the identity precompile?
… On May 23, 2022, at 4:16 AM, 0xca11.eth ***@***.***> wrote:
Implemented this optimization using the identity precompile on this fork in case anyone's interested: ***@***.***
@z0r0z @wighawag Please let me know if a PR with this change would be welcome :)
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you commented.
|
This loop could be replaced with CALLDATACOPY():
clones-with-immutable-args/src/ClonesWithImmutableArgs.sol
Lines 126 to 134 in 5950723
The text was updated successfully, but these errors were encountered: