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

Propagate pooled arrays to RlpStream #6536

Merged
merged 1 commit into from
Jan 14, 2024
Merged

Propagate pooled arrays to RlpStream #6536

merged 1 commit into from
Jan 14, 2024

Conversation

benaadams
Copy link
Member

@benaadams benaadams commented Jan 14, 2024

Follow up to Perf/poolable triestore #6022

Changes

  • Propagate pooled arrays to RlpStream, by having is backing storage be CappedArray<byte>; rather than have it create an array if the pooled array is not same size as data.
  • Pre-generate encoded array for numeric keys 0 to 1024 and reuse those rather than regenerating each time.
  • Enclose the temp trie methods TxTrie.CalculateRoot, ReceiptTrie.CalculateProof, TxTrie.CalculateRoot, ReceiptTrie.CalculateProof in static method using the pooling and switch everything over to use them; rather than multistep unpooled.

Left before, right after

image

Types of changes

What types of changes does your code introduce?

  • Optimization

Testing

Requires testing

  • No

@benaadams benaadams merged commit 3c045bf into master Jan 14, 2024
67 checks passed
@benaadams benaadams deleted the RlpStream branch January 14, 2024 11:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants