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

opt: reduce allocs for parse_deposits_from_receipts #11949

Merged
merged 5 commits into from
Oct 22, 2024

Conversation

prestwich
Copy link
Collaborator

Removes allocations by preventing the creation of an intermediate Bytes object for each deposit request bytestring. Instead, they're accumulated into a single vec. This ensures at most 1 allocation per deposit request, while the previous version had 2

Also removes some outdated docstrings and comments

According to etherscan, there is typically less than 1 of these per block, so this is a minor-but-easy optimization :)

@prestwich prestwich force-pushed the prestwich/accumulate-requests branch from 0d37850 to 5ee55fd Compare October 21, 2024 21:38
Copy link
Collaborator

@mattsse mattsse left a comment

Choose a reason for hiding this comment

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

lgtm

pending @onbjerg

Copy link
Member

@onbjerg onbjerg left a comment

Choose a reason for hiding this comment

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

lgtm also, ty

@onbjerg onbjerg added C-perf A change motivated by improving speed, memory usage or disk footprint E-prague Related to the prague network upgrade labels Oct 22, 2024
@onbjerg onbjerg added this pull request to the merge queue Oct 22, 2024
Merged via the queue into main with commit 90aaad8 Oct 22, 2024
38 checks passed
@onbjerg onbjerg deleted the prestwich/accumulate-requests branch October 22, 2024 12:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-perf A change motivated by improving speed, memory usage or disk footprint E-prague Related to the prague network upgrade
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants