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 collection resizing costs #7360

Merged
merged 12 commits into from
Aug 29, 2024
Merged

Reduce collection resizing costs #7360

merged 12 commits into from
Aug 29, 2024

Conversation

benaadams
Copy link
Member

@benaadams benaadams commented Aug 25, 2024

Changes

  • Clear ConcurrentDictionary backing directly rather than using .Clear which resizes it to 31 elements meaning are many resizing costs to bring back up to size when repopulating
  • Clear evm collections rather than resizing down to avoid paying the resizing back up costs
  • When pruning use the array if created, rather than reenumerating the dictionary
  • Clear precomplie cache (bugfix)

Types of changes

What types of changes does your code introduce?

  • Bugfix (a non-breaking change that fixes an issue)
  • Optimization

Testing

Requires testing

  • No

@benaadams benaadams force-pushed the collection-resizes branch 2 times, most recently from 708ffcb to 5967d72 Compare August 26, 2024 17:49
@benaadams benaadams marked this pull request as ready for review August 27, 2024 04:40
@benaadams benaadams changed the title Reduce collection resizing Reduce collection resizing costs Aug 27, 2024
@LukaszRozmej
Copy link
Member

Can you also explain/show any real gains from this?

@benaadams benaadams merged commit 29f2a20 into master Aug 29, 2024
66 checks passed
@benaadams benaadams deleted the collection-resizes branch August 29, 2024 15:16
Scooletz pushed a commit that referenced this pull request Sep 3, 2024
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