As the number of packages to resolve increases there appears to be an O(n2) calls to _is_current_pin_satisfying and I think, at least in some circumstances, it's possible to optimize this away.
I am using steps to reproduce from pypa/pip#12320 and the branch from this PR to avoid network calls in the call graph pypa/pip#12327 and not have O(n2) calls to Pip collecting packages from local directory. In the future I plan to be able to show this performance issue using https://github.com/pradyunsg/pip-resolver-benchmarks
In this example there are ~1300 packages to install and _is_current_pin_satisfying is called ~2.5 million times, I generated the call graph using cProfile and gprof2dot:

I have not yet investigated how one might optimize this.
This is motivated from a real world usage report: pypa/pip#12314.
As the number of packages to resolve increases there appears to be an O(n2) calls to
_is_current_pin_satisfyingand I think, at least in some circumstances, it's possible to optimize this away.I am using steps to reproduce from pypa/pip#12320 and the branch from this PR to avoid network calls in the call graph pypa/pip#12327 and not have O(n2) calls to Pip collecting packages from local directory. In the future I plan to be able to show this performance issue using https://github.com/pradyunsg/pip-resolver-benchmarks
In this example there are ~1300 packages to install and
_is_current_pin_satisfyingis called ~2.5 million times, I generated the call graph using cProfile and gprof2dot:I have not yet investigated how one might optimize this.
This is motivated from a real world usage report: pypa/pip#12314.