-
Notifications
You must be signed in to change notification settings - Fork 209
refactor(levm): remove clones for account structs #2684
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
Merged
Merged
Changes from 15 commits
Commits
Show all changes
26 commits
Select commit
Hold shift + click to select a range
aa63238
Changed account updates to happen only if update info isnt empty
SDartayet 4991f3a
Removed clone in account storage updating
SDartayet 2030363
Refactored database functions to make them return references, removed…
SDartayet 5d42563
Fixed warnings and ran cargo fmt
SDartayet 115c9cd
Merge branch 'main' into remove-clones
SDartayet 1a714e6
Ran cargo fmt
SDartayet f6efb76
Merge branch 'main' into remove-clones
SDartayet 1c22fb4
Fixed some merge issues
SDartayet 39aa796
Merge branch 'main' into remove-clones
SDartayet b1f9d96
Merge branch 'main' into remove-clones
SDartayet 47d634a
Fixed some nits and removed another clone
SDartayet 4f7025d
Fixed compiler errors
SDartayet b28a9fb
Reverted removing a clone
SDartayet bc7a9ea
Merge branch 'main' into remove-clones
SDartayet c10d204
Merge branch 'main' into remove-clones
SDartayet 20f5ebf
Merge branch 'main' into remove-clones
SDartayet a607c4e
Fixed typo in environment.rs
SDartayet 070df9c
Fixed typo in environment.rs
SDartayet 5808bbc
Ran cargo fmt
SDartayet d554a10
Merge branch 'main' into remove-clones
SDartayet 7293df3
Added perf changelog
SDartayet eee94f5
Removed unnecessary inner scope
SDartayet 575dd42
Removed unnecessary inner scope
SDartayet bd4c997
Removed account info clone
SDartayet e98bcec
Replaced get account for access account
SDartayet 9c6ce64
Merge branch 'main' into remove-clones
SDartayet File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Honestly here I'd just do:
self.accounts.insert(update.address, info.clone());It is way more simple and we are just cloning account info, which is pretty small. I think it is worth it for making the code simpler because the perfromance difference is negligible I'd say.
We should optimize for performance when cloning an entire
Accountthat has storage in it. But these cases in which we cloneAccountInfoare probably not significant. And we prefer simplicity in this scenario.What do you think?
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.
Agree given that it should be pretty small and we want to go for simplicity. Also it will be better for isolating the changes, if we want to test the performance impact of removing the clones of AccountInfo we can do it in another branch