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

Fix memory issues #142

Merged
merged 3 commits into from
Sep 22, 2023
Merged

Fix memory issues #142

merged 3 commits into from
Sep 22, 2023

Conversation

zschira
Copy link
Member

@zschira zschira commented Sep 22, 2023

This PR fixes the high memory usage introduced in 1.0.0. This problem was caused by parsing Instance's at the beginning, and passing the parsed objects to the worker processes. These objects are quite large, and get copied when passed to subprocesses, which lead to huge increases in total memory usage. This PR reverts to parsing these objects when they are needed in each subprocess. It also slightly reworks some integration tests to accommodate this change.

@codecov
Copy link

codecov bot commented Sep 22, 2023

Codecov Report

Patch coverage: 100.00% and project coverage change: +1.34% 🎉

Comparison is base (9e2633f) 91.75% compared to head (94fa9d7) 93.09%.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #142      +/-   ##
==========================================
+ Coverage   91.75%   93.09%   +1.34%     
==========================================
  Files           8        8              
  Lines         594      594              
==========================================
+ Hits          545      553       +8     
+ Misses         49       41       -8     
Files Changed Coverage Δ
src/ferc_xbrl_extractor/instance.py 93.70% <100.00%> (-0.66%) ⬇️
src/ferc_xbrl_extractor/xbrl.py 91.46% <100.00%> (+10.74%) ⬆️

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

Copy link
Member

@jdangerx jdangerx left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wow, this turned out a lot cleaner than I expected - didn't really have to change too much! Nice :)

@zschira zschira merged commit 9ceda54 into main Sep 22, 2023
10 checks passed
@zschira zschira deleted the fix-memory-issues branch September 22, 2023 17:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

2 participants