-
Notifications
You must be signed in to change notification settings - Fork 239
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
Decreased performance after replacing multiprocessing.dummy with concurrent.futures #476
Comments
Hmmm. Thanks for these tests Patrick! |
Thanks for this. I will hold the 2.4.0 release until we have clarified this (unless people starts having lots of issues with pydantic, in which case I will revert the PR that introduced this change so we can reevaluate for 2.5.0) |
@ogenstad Patrick, I am sorry, I don't see the same problem.
Here is the code for
Here are results:
Difference is small and submit One weird thing I noticed was with Do you mind re-testing the same way I did? What is your operating system by the way? |
I think at this point we have two options:
There is no real benefit of migrating away from |
I am biased since I submitted PR, but I'd prefer not to revert it unless we have enough evidence it is causing issues. |
I did a quick test with my code from https://github.com/networklore/networklore-demos/tree/master/python/nornir/ansible-nornir-speed
Basically the PR #467, made this twice as slow. I'm guessing that the change was made after checking a task where we were mostly waiting for the network where my example is related to local processing. As the example with concurrent.futures isn't faster for the network task I would vote to revert #467. The description of Nornir is "Pluggable multi-threaded framework with inventory management to help operate collections of devices", I think this should perhaps clarify any misconception regarding multiprocessing or threading. If we want to be extra helpful I guess we can insert a comment above the
from multiprocessing.dummy import Pool
line, I'm not sure that I see it as a big problem though./cc @dmfigol
The text was updated successfully, but these errors were encountered: