Skip to content

Conversation

@defistar
Copy link

use Arc to reduce memory cloning in TrieUpdates

Replace owned BranchNodeCompact with Arc-wrapped nodes across trie data structures. This optimization significantly reduces memory allocations during block aggregation in RPC caches by sharing nodes instead of deep cloning ~112-byte structures.

Impact: ~3x faster extend_ref() calls (440µs vs 1,357µs for 1024 blocks) and 14x memory reduction per node (8 bytes Arc pointer vs 112 bytes full clone).

…ieUpdates

Replace owned BranchNodeCompact with Arc-wrapped nodes across trie data structures.
This optimization significantly reduces memory allocations during block aggregation
in RPC caches by sharing nodes instead of deep cloning ~112-byte structures.

Impact: ~3x faster extend_ref() calls (440µs vs 1,357µs for 1024 blocks) and 14x
memory reduction per node (8 bytes Arc pointer vs 112 bytes full clone).
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.

2 participants