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

Pre-allocate ops slices that are appended in a loop where possible. #743

Merged
merged 1 commit into from
Sep 8, 2024

Conversation

avalonbits
Copy link
Contributor

This ensures that only one larger allocation is done instead of multiple small ones, reducing pressure on the garbage collector.

@avalonbits avalonbits changed the title Pre-allocate ops slices that are appened in a loop where possible. Pre-allocate ops slices that are appended in a loop where possible. Sep 4, 2024
Copy link
Contributor

@brianolson brianolson left a comment

Choose a reason for hiding this comment

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

Yup. This is a better pattern. Thank you.

Copy link
Collaborator

@bnewbold bnewbold left a comment

Choose a reason for hiding this comment

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

thanks!

@bnewbold bnewbold merged commit 5ea1281 into bluesky-social:main Sep 8, 2024
2 checks passed
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.

3 participants