Skip to content

Concurrency #75

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

Merged
merged 4 commits into from
Jul 25, 2024
Merged

Concurrency #75

merged 4 commits into from
Jul 25, 2024

Conversation

dimkarakostas
Copy link
Member

All Submissions:

  • Have you followed the guidelines in our Contributing documentation?
  • Have you verified that there aren't any other open Pull Requests for the same update/change?
  • Does the Pull Request pass all tests?

Description

Enables concurrency during analyzing. Adds a helper function that computes the max number of parallel processes that can run per ledger (based on the memory consumption of each ledger's largest file) and uses Python's multiprocessing to analyze snapshots with multiple parallel processes.

Copy link
Member

@LadyChristina LadyChristina left a comment

Choose a reason for hiding this comment

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

Looks good, please address comments (esp. requirements.txt one) and merge (assuming that the tests pass then)


# Find if some ledger files are too large to fit in the system's available memory.
too_large_ledgers = set()
for ledger in get_ledgers():
Copy link
Member

Choose a reason for hiding this comment

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

I don't see why this loop is needed, can't it be done within the previous loop? (starting in L623)

@@ -6,7 +6,7 @@
import os
import datetime
import calendar
import argparse
import psutil
Copy link
Member

Choose a reason for hiding this comment

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

Needs to be added to requirements.txt

@dimkarakostas dimkarakostas merged commit c765887 into main Jul 25, 2024
1 check passed
@dimkarakostas dimkarakostas deleted the concurrency branch July 25, 2024 13:54
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