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

Stream downloads to save memory #1021

Merged
merged 3 commits into from
Jul 3, 2023
Merged

Stream downloads to save memory #1021

merged 3 commits into from
Jul 3, 2023

Conversation

McToel
Copy link
Contributor

@McToel McToel commented Jun 28, 2023

This addresses #1016.

The changes were way simpler than I thought, but it only saves about 33% of memory. That's still quite good, I think.

Due to the streaming, I had to remove a log message, as it is no longer possible to count the downloaded data before consuming it.

Any suggestions for code improvements are welcome, and I have not run any benchmarks yet, on how much memory it is saving. The 33% come from looking at the memory usage of Python in my system monitor.

@gboeing
Copy link
Owner

gboeing commented Jun 29, 2023

@McToel looks like tests are failing.

@codecov
Copy link

codecov bot commented Jun 30, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 98.06%. Comparing base (f38ddd1) to head (d48bd72).

Additional details and impacted files
@@            Coverage Diff             @@
##              mem    #1021      +/-   ##
==========================================
- Coverage   98.07%   98.06%   -0.01%     
==========================================
  Files          24       24              
  Lines        2439     2430       -9     
==========================================
- Hits         2392     2383       -9     
  Misses         47       47              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@gboeing gboeing changed the base branch from main to mem July 3, 2023 14:12
@gboeing gboeing merged commit f1fd4f9 into gboeing:mem Jul 3, 2023
6 checks passed
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