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

Avoid allocation in CowBytes if possible #3120

Merged
merged 2 commits into from
Oct 13, 2024
Merged

Conversation

nazar-pc
Copy link
Member

Instead of allocating unconditionally try to reuse original allocation if possible. BytesMut::from() tries to reuse allocation if possible.

Code contributor checklist:

Copy link
Contributor

@teor2345 teor2345 left a comment

Choose a reason for hiding this comment

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

Thanks!

@teor2345
Copy link
Contributor

This will need a branch update before it can auto-merge, I’ll do that now.

@nazar-pc nazar-pc added this pull request to the merge queue Oct 13, 2024
Merged via the queue into main with commit 894f55f Oct 13, 2024
8 checks passed
@nazar-pc nazar-pc deleted the tiny-piece-optimization branch October 13, 2024 22:40
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.

2 participants