Skip to content

For n packages there are O(n^2) calls to _is_current_pin_satisfying  #147

Description

@notatallshaw

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:

output

I have not yet investigated how one might optimize this.

This is motivated from a real world usage report: pypa/pip#12314.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions