Skip to content

Conversation

@ANtutov
Copy link
Contributor

@ANtutov ANtutov commented Dec 4, 2025

Encode account RLP into a fresh Vec and move it into the trie instead of cloning a reusable buffer. This removes one allocation and memcpy per account update. The persistent buffer in SparseStateTrie was removed since the trie must own the bytes; keeping it yielded no benefit and forced a clone. Mirrored the same change in the stateless path for consistency. Only allocation and copy reductions.

@mediocregopher
Copy link
Collaborator

This removes one allocation and memcpy per account update
Can you explain how so? The clone was previously an allocation, now you're allocating on the Vec::with_capacity instead. Functionally this looks equivalent to me, just a bit cleaner because no need for a reusable buffer. Just to check I'm understanding right...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Backlog

Development

Successfully merging this pull request may close these issues.

2 participants