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

Reduce allocations in Queue and Memory estimations #5030

Merged
merged 1 commit into from
Dec 29, 2022

Conversation

benaadams
Copy link
Member

Changes:

  • Cache counts and reuse if ConcurrentDictionary not changed
  • Reuse ConcurrentDictionary enumerator
  • Iterate rather than using Linq when calculating

Removes the allocations from ShouldBuildANewBatch

image

Types of changes

What types of changes does your code introduce?
Put an x in the boxes that apply

  • Bugfix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation Update
  • Code style update (formatting, renaming)
  • Refactoring (no functional changes, no api changes)
  • Build related changes
  • Other (please describe):

Testing

Requires testing

  • Yes
  • No

@benaadams benaadams force-pushed the Count-caching branch 2 times, most recently from 1e0411a to 69ab37d Compare December 23, 2022 19:36
Copy link
Contributor

@asdacap asdacap left a comment

Choose a reason for hiding this comment

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

LGTM

@asdacap asdacap merged commit c491724 into NethermindEth:master Dec 29, 2022
@benaadams benaadams deleted the Count-caching branch December 29, 2022 08:43
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.

None yet

3 participants