Closed bersbersbers closed 3 years ago
The above is with pip==20.2.4
. I get an error for pip==20.3b1
(which does not reproduce in the current dev
version, so I'll skip posting that one). In the current dev
version, runtime of the (new default) resolver is down to 16 seconds (compared to 9 seconds with the old resolver in 20.2.4
).
Sounds like you’re getting the benefit from #9078 (merged after 20.2.4). Closing, feel free to reopen if you don’t think this assessment is correct.
The new resolver is always going to be slower, since it actually tries to make sure your requirement set is consistent. You do not need those checks here since all your requirements are pinned exactly with ==
, and should be able to skip all the checks with --no-deps
.
--outdated
is slower here also because all the requirements are already installed. Those on-disk installation can be re-used directly; --outdated
, by contrast, needs to make additional queries to know whether the installed version is outdated or not, and thus slower.
Overall, everything that you've observed is expected.
There's a (usually small) performance hit when using the new resolver -- which is only used in the install, wheel and download commands BTW. It's a new chunk of code, with different performance characteristics than the old resolver, because this one takes dependency conflicts into account.
The new resolver is always going to be slower, since it actually tries to make sure your requirement set is consistent.
I do understand that in principle. I still wonder what it is actually doing for 45 (now 7, but still) seconds. If it's not network requests and associated delays, I see nothing that should take that long. Then again, I am only an interested user, so there may be good reasons for that, and if you tell me that's expected, I am going to believe you :)
You do not need those checks here since all your requirements are pinned exactly with
==
I'm not sure this is correct: note that I am using sed 's/==.*//'
to remove all these pinnings.
and should be able to skip all the checks with
--no-deps
.
I'm not sure this is correct, either: what if a package is updated to include a new requirement? I certainly want these to be installed, too.
--outdated
is slower here also because all the requirements are already installed. Those on-disk installation can be re-used directly;--outdated
, by contrast, needs to make additional queries to know whether the installed version is outdated or not, and thus slower.
But the dependency resolvers needs to make these exact same queries, don't they? Note that my xargs pip install
is passed all installed packages, and to me, --upgrade-strategy eager
implies that they will make "additional queries to know whether the installed version is outdated or not". Again, I don't see why this should be slower. Compatible with this, as noted above, I saw that there were no additional "GET" queries.
@bersbersbers thank you for your questions! Could I ask you to copy or move your last comment to #9187 if you are still experiencing the problem with pip 20.3? Sorry for the bother.
What did you want to do? I liked to use
to update all packages. However, this updates packages beyond the requirements of installed packages, which
pip
ignores, leading to conflicts.Same thing even for
Now, the new resolver looks promising in the second case (it still ignores installed packages, so
--outdated
is not an option, but that's not too much of an issue):It upgrades only what's possible to upgrade without causing conflicts, and even downgrades what's required to resolve conflicts. It's basically a one-stop-shop to fix a set of installed packages. Nicely done!
However, it's slow:
pip list --outdated
takes ~15spip list | sed | xargs pip install
takes ~9s with the old resolver (in its 2nd run when all package installation have finished), but it takes ~55s with the new resolver (again, in its 2nd run without package installation)I'm surprised that
pip list | sed | xargs pip install
is faster thanpip list --outdated
because I expect the latter to do much more than the former, but that's not what I am worried about. But note how much slowerpip list | sed | xargs pip install
is with the new resolver. I first suspected additional (repeated) HTTP requests for the same packages as an issue, butshows the same (125) requests as
Additional information