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

Perf/optimize old bodies memory #6008

Merged
merged 16 commits into from
Aug 22, 2023
Merged

Conversation

asdacap
Copy link
Contributor

@asdacap asdacap commented Aug 17, 2023

  • Reduces memory allocation during OldBodies.
  • Works by:
    • Slices Memory<byte> from netty buffer when deserializing Transaction.Data.
    • Slices Memory<byte> form netty buffer when setting Transaction._preHash.
    • Pool Transaction.
  • Tried to make it a refstruct, but failed.

(after, before, after, before, after, before)
Screenshot_2023-08-17_09-40-12

Changes

  • Create OwnedBlockBodies which must be disposed.
  • Modified block bodies message deserializer to slice Memory<byte>
  • Modified TX decoder to use pooled Transaction object.

Types of changes

What types of changes does your code introduce?

  • Optimization

Testing

Requires testing

  • Yes
  • No

If yes, did you write tests?

  • Yes
  • No

Mainnet bodies from ancient barriers to block 12572600 matches. Took too long to wait until head.

@asdacap asdacap marked this pull request as ready for review August 17, 2023 08:51
@asdacap asdacap merged commit 09bd1ae into master Aug 22, 2023
61 checks passed
@asdacap asdacap deleted the perf/optimize-old-bodies-memory branch August 22, 2023 10:50
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.

None yet

2 participants