-
Notifications
You must be signed in to change notification settings - Fork 189
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
refactor(store): optimize Storage library #1194
Conversation
🦋 Changeset detectedLatest commit: 11c04a4 The changes in this PR will be included in the next version bump. This PR includes changesets to release 26 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
// Solidity's YulUtilFunctions::roundUpFunction | ||
function round_up_to_mul_of_32(value) -> _result { | ||
_result := and(add(value, 31), not(31)) | ||
} |
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.
can't really make a solidity function for this so figured I'd just copy the one solidity uses internally
do we have a measurement for "load cold"? |
no, that's intentional, the cold margin is similar for read/write and didn't feel necessary to overdo gas metrics; I can add it if u're interested |
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 is great!
just feels like something that would be good for completeness, i'm sure people will ask about it |
sure will add in a few mins; we shouldn't make these metrics too visible for end users though, that'd be the role of table metrics (which I have yet to add). This stuff is kinda misleading and concerns an internal library most people don't need to understand |
surprised I got
storage write (warm, 10 words)
to be more efficient than soliditybut also it doesn't mean anything, this is apples to oranges:
mud/packages/store/test/Gas.t.sol
Lines 107 to 110 in b4a6864
Not a fan of how big the relative difference in
load (warm, 1 word)
is but it's kinda unavoidable. Rough estimate of reasons:(warm, 1 word, partial)
for jagged head