Skip to content

filesync: reuse data buffer for diffcopy#5442

Merged
tonistiigi merged 1 commit intomoby:masterfrom
jsternberg:filesync-diffcopy-reuse-buffer
Oct 22, 2024
Merged

filesync: reuse data buffer for diffcopy#5442
tonistiigi merged 1 commit intomoby:masterfrom
jsternberg:filesync-diffcopy-reuse-buffer

Conversation

@jsternberg
Copy link
Copy Markdown
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 <[email protected]>
@jsternberg
Copy link
Copy Markdown
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
@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