execution/commitment: reuse branch buffers instead of cloning every read - #23617
Open
awskii wants to merge 2 commits into
Open
execution/commitment: reuse branch buffers instead of cloning every read#23617awskii wants to merge 2 commits into
awskii wants to merge 2 commits into
Conversation
…d of cloning every branch read
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Commitment allocated a fresh copy on every branch read.
TrieContext.Branchcloned each result, andgetDeferredUpdate/mergeDeferredUpdateclonedprevand the mergedencoded.Changes
TrieContext.Branchcopies into a per-context buffer;LatestCommitmentStateclones at its own call site.getDeferredUpdatetakesprevthrough the existingreuseBytesinstead of cloning — the nil-vs-empty contract it cited is whatreuseBytesalready implements.mergeDeferredUpdatewrites the merged value into a dedicatedencodedBuf, soencodedeither aliasesrawor points at a buffer that survives pooling.Notes
Mainnet archive node syncing from genesis, 16 cores / 125 GB,
--experimental.parallel-commitment, settled windows either side of the change:bytes.CloneCPU is flat: the gain is GC pressure removed from the serial commitment path, not cycles saved.