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

Pool is faster than ThreadPool in some situations #57

Closed
apcamargo opened this issue Jul 9, 2024 · 1 comment
Closed

Pool is faster than ThreadPool in some situations #57

apcamargo opened this issue Jul 9, 2024 · 1 comment
Labels
documentation Improvements or additions to documentation

Comments

@apcamargo
Copy link

Not really a bug, but I'm posting this here to make it easier to find. We talked about it over email before, but someone brought it up to me again. Figured it'd be good to make this information searchable.

Pyrodigal's CLI command uses multiprocessing.pool.ThreadPool for parallel gene calling. The documentation suggests using ThreadPool too. But in my benchmarks, multiprocessing.pool.Pool was way faster. I mentioned this to @althonos, who did some tests and found that Pool is faster than ThreadPool when there are lots of CPUs available (though we didn't do super in-depth tests to figure out why).

If Pyrodigal is running slow for you, try using multiprocessing.pool.Pool instead. There's an example you can check out here.

@althonos
Copy link
Owner

Thanks for the report! Not sure in which case which one of threads and process pools is better, otherwise I'd select the best one by default when possible... For now I'm keeping threads as a default, but:

@althonos althonos added the documentation Improvements or additions to documentation label Jul 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Projects
None yet
Development

No branches or pull requests

2 participants