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

meaningless cache adding in the pruning #936

Open
cool-develope opened this issue Apr 25, 2024 · 0 comments
Open

meaningless cache adding in the pruning #936

cool-develope opened this issue Apr 25, 2024 · 0 comments

Comments

@cool-develope
Copy link
Collaborator

cool-develope commented Apr 25, 2024

Context

Currently, iavl v1 nodeCache is not working efficiently. It adds the node to the cache whenever it gets the node. There are some meaningless usecases. Furthermore, it is leading to extra delays.

  • Pruning: Those nodes are added to the cache before deleting.
  • Querying: The querying is random access, there is no guarantee of re-visiting.

Proposal

  • Only adds to the cache whenever the node is created. This way, we can leverage access to the top-level nodes of the tree like the root, actually these nodes are highly frequently visited.
  • Use sync.Pool in the GetNode to leverage the memory re-use which is introduced in iavl v2.
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

No branches or pull requests

1 participant