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

perf(tree): hierarchical storage cache with mini-moka for cross-block caching #14047

Merged

Conversation

fgimenez
Copy link
Member

@fgimenez fgimenez commented Jan 28, 2025

Instead of keys like (Address, StorageKey) and values StorageValue, this PR proposes a hierarchical structure with keys Address and values Cache<StorageKey, StorageValue>, this aims to improve memory utilization (no need to repeat Address for each slot) and to make entry invalidation simpler (flat approach requires iterating over all the slot of an address).

Also switches from moka to the lighter mini-moka.

@fgimenez fgimenez force-pushed the fgimenez/address-key-storage-cache branch from 8ef3413 to 83b4cbd Compare January 29, 2025 08:38
@fgimenez fgimenez force-pushed the fgimenez/address-key-storage-cache branch from a0188be to afe51fa Compare January 30, 2025 11:06
@fgimenez fgimenez changed the title address key for storage cache feat(engine): hierarchical storage cache with mini-moka for cross-block caching Jan 30, 2025
@fgimenez fgimenez added C-perf A change motivated by improving speed, memory usage or disk footprint A-engine Related to the engine implementation C-enhancement New feature or request labels Jan 30, 2025
@fgimenez fgimenez added A-execution Related to the Execution and EVM and removed A-engine Related to the engine implementation labels Jan 30, 2025
@fgimenez fgimenez changed the title feat(engine): hierarchical storage cache with mini-moka for cross-block caching perf(tree): hierarchical storage cache with mini-moka for cross-block caching Jan 30, 2025
Copy link
Member

@Rjected Rjected left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

great, I think we can determine memory limits separately / in a new PR

@fgimenez fgimenez marked this pull request as ready for review January 30, 2025 21:21
@fgimenez fgimenez merged commit 628ac03 into dan/add-cross-block-caching Jan 30, 2025
37 checks passed
@fgimenez fgimenez deleted the fgimenez/address-key-storage-cache branch January 30, 2025 21:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-execution Related to the Execution and EVM C-enhancement New feature or request C-perf A change motivated by improving speed, memory usage or disk footprint
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants