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

Should we cache storage trie for accounts? #32

Open
mohanson opened this issue Feb 26, 2019 · 0 comments
Open

Should we cache storage trie for accounts? #32

mohanson opened this issue Feb 26, 2019 · 0 comments
Labels
enhancement New feature or request

Comments

@mohanson
Copy link
Collaborator

See: #31 (comment)

First of all, we already have 2 layer caches in use when call get_storage:

Call get_storage()
     ⬇
Account.storage_changes 
     ⬇
K-V Cache on DB
     ⬇
Disk DB

From @yejiayu

When querying an uncached key, if you can reuse the previous path, you can reduce the consumption of many database IO and recovery node.
However, this will use more memory and the number of node that need to be calculated per commit will increase, because the hash node will be restored from the database.
So this optimization requires serious thinking.

Cache the whole storage_trie will speed up(maybe a bit) the performance, but the price is get more complexity in codes.

@mohanson mohanson added the enhancement New feature or request label Feb 26, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant