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

Remove unnecessary look up for old values #783

Merged
merged 4 commits into from
Jul 3, 2024

Conversation

xgreenx
Copy link
Collaborator

@xgreenx xgreenx commented Jul 1, 2024

The change adds new replace and take methods into the StorageMutate traits. These new methods work as the old ones. Old methods were changed to not return the value.

Most of all, places that were using insert and remove don't need an old value. This helps to remove unnecessary lookups to the storage. An example is the Sparse Merkle tree. It only inserts new nodes and removes old nodes without handling the old values since it is not important for the tree.

I helped to decrease lookups to the storage in the testnet by 30%.

Checklist

  • Breaking changes are clearly marked as such in the PR description and changelog

Before requesting review

  • I have reviewed the code myself

@xgreenx xgreenx requested a review from a team July 1, 2024 09:30
@xgreenx xgreenx self-assigned this Jul 1, 2024
Dentosal
Dentosal previously approved these changes Jul 1, 2024
@xgreenx xgreenx added this pull request to the merge queue Jul 1, 2024
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to a conflict with the base branch Jul 1, 2024
@xgreenx xgreenx requested review from Dentosal and a team July 1, 2024 13:10
@xgreenx xgreenx added this pull request to the merge queue Jul 3, 2024
Merged via the queue into master with commit f476cf4 Jul 3, 2024
39 checks passed
@xgreenx xgreenx deleted the feature/remove-unnesasary-look-up branch July 3, 2024 06:20
@xgreenx xgreenx mentioned this pull request Jul 4, 2024
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.

3 participants