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

Reduce memory usage while downloading release #2

Merged
merged 1 commit into from Dec 7, 2021
Merged

Reduce memory usage while downloading release #2

merged 1 commit into from Dec 7, 2021

Conversation

c-w
Copy link
Contributor

@c-w c-w commented Dec 7, 2021

This pull request optimizes the code to download the release tarball with two changes:

  1. Use context managers to automatically close the output file and HTTP response object removing the need for an explicit close call and handling the resource cleanup in cases of unexpected crashes, etc.
  2. Instead of reading the entire response into memory, download it in chunks and write to the output file as the chunks arrive, curtsy of shutil.copyfileobj.

@wlav wlav merged commit 83589ae into wlav:master Dec 7, 2021
@c-w c-w deleted the improve-download branch December 7, 2021 19:59
sudo-panda pushed a commit to sudo-panda/cppyy-backend that referenced this pull request Feb 23, 2023
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.

None yet

2 participants