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

Use a persistent process pool instead of a context manager #260

Merged

Conversation

jakobj
Copy link
Member

@jakobj jakobj commented Dec 21, 2020

A persistent worker pool avoids the overhead associated with creating and destroying processes. This results in a significant speedup when function evaluations are not too expensive. For example, the minimal example runs approximately twice as fast (~11s w/ context manager, ~5s w/ persistent pool). For a larger number of processes this difference becomes larger.

@jakobj jakobj added the enhancement New feature or request label Dec 21, 2020
@jakobj jakobj added this to the 0.3.0 milestone Dec 21, 2020
@coveralls
Copy link
Collaborator

coveralls commented Dec 21, 2020

Coverage Status

Coverage increased (+0.03%) to 95.34% when pulling f6685a2 on jakobj:enh/persistent-process-pool into bea3cdc on Happy-Algorithms-League:master.

Copy link
Member

@mschmidt87 mschmidt87 left a comment

Choose a reason for hiding this comment

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

lgtm

@jakobj jakobj merged commit 7390891 into Happy-Algorithms-League:master Dec 26, 2020
@jakobj jakobj deleted the enh/persistent-process-pool branch December 26, 2020 14:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants