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

filesync: reuse data buffer for diffcopy #5442

Merged
merged 1 commit into from
Oct 22, 2024

Conversation

jsternberg
Copy link
Collaborator

Reuse the bytes message data buffer for diffcopy to allow memory to be reused when unmarshaling the bytes.

Reuse the bytes message data buffer for diffcopy to allow memory to be
reused when unmarshaling the bytes.

Signed-off-by: Jonathan A. Sternberg <jonathan.sternberg@docker.com>
@jsternberg
Copy link
Collaborator Author

Tested with:

echo 'from golang' | BUILDX_MEM_PROFILE=mem.pprof ./docker-buildx build -o type=oci - > /dev/null

Resulted in the memory allocations going from 500 MB to 100 MB in filesync.writeTargetFile.

@tonistiigi tonistiigi merged commit a82a79d into moby:master Oct 22, 2024
91 checks passed
@jsternberg jsternberg deleted the filesync-diffcopy-reuse-buffer branch October 22, 2024 14:34
@crazy-max crazy-max added this to the v0.17.0 milestone Oct 25, 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.

3 participants