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

copyZeroAlloc: Try WriteTo and ReadFrom before acquiring a buffer #1673

Merged
merged 1 commit into from
Dec 2, 2023

Conversation

Jille
Copy link
Contributor

@Jille Jille commented Dec 1, 2023

These are the same statements at the beginning of io.CopyBuffer, but by doing them ourselves first we trade off a little cpu for not holding the 4kb buffer during the write.

These are the same statements at the beginning of io.CopyBuffer, but
by doing them ourselves first we trade off a little cpu for not holding
the 4kb buffer during the write.
@Jille
Copy link
Contributor Author

Jille commented Dec 1, 2023

I only ran go test, no other testing nor benchmarks.

@erikdubbelboer erikdubbelboer merged commit 2ac2a39 into valyala:master Dec 2, 2023
14 checks passed
@erikdubbelboer
Copy link
Collaborator

Thanks! Makes sense.

@Jille Jille deleted the copy-zero-alloc-nobuf branch December 3, 2023 20:02
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