salt icon indicating copy to clipboard operation
salt copied to clipboard

pip module is taking "too long"

Open syedaali opened this issue 11 years ago • 3 comments

When I use pip.installed, I noticed that a typical minion run takes a "very long" time, compared to doing a cmd.run with pip. Below is an example:

----------
          ID: psycopg2
    Function: pip.installed
      Result: True
     Comment: Python package psycopg2 was already installed
              All packages were successfully installed
     Started: 03:42:29.180285
    Duration: 17150.999 ms
     Changes:
----------
          ID: sqlalchemy
    Function: pip.installed
      Result: True
     Comment: Python package sqlalchemy was already installed
              All packages were successfully installed
     Started: 03:42:46.332172
    Duration: 26716.507 ms
     Changes:
----------
          ID: petl
    Function: pip.installed
      Result: True
     Comment: Python package petl was already installed
              All packages were successfully installed
     Started: 03:43:13.049607
    Duration: 43691.612 ms
     Changes:
----------
          ID: jira
    Function: pip.installed
      Result: True
     Comment: Python package jira was already installed
              All packages were successfully installed
     Started: 03:43:56.742153
    Duration: 29640.447 ms
     Changes:

The above is based upon:

psycopg2:
  pip.installed:
    - name: psycopg2

sqlalchemy:
  pip.installed:
    - name: sqlalchemy

petl:
  pip.installed:
    - name: petl

jira:
  pip.installed:
    - name: jira

Total run time: 456.647 s

On the other hand if I process the above with cmd.run the time taken is much shorted as seen below:

pips:
  cmd.run:
  - name: pip install psycopg2 sqlalchemy pets jira

Total run time: 145.564 s

syedaali avatar Nov 10 '15 05:11 syedaali

Bit of an unfair comparison - pip install pkg1 pkg2 pkg3 will probably always be faster than pip install pkg1; pip install pkg2; pip install pkg3

I agree that the pip-related module is quite slow, though.

anlutro avatar Nov 10 '15 08:11 anlutro

@syedaali, thanks for the report. I agree with @anlutro, though. How long does it take to run:

pip-packages:
  pip.installed:
    - pkgs:
      - psycopg2
      - sqlalchemy
      - pets
      - jira

or even just

$ pip install psycopg2 sqlalchemy pets jira

jfindlay avatar Nov 11 '15 05:11 jfindlay

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

If this issue is closed prematurely, please leave a comment and we will gladly reopen the issue.

stale[bot] avatar Feb 07 '18 22:02 stale[bot]