Skip to content
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

Speedup printing of installed package versions #5127

Merged
merged 1 commit into from
Jun 19, 2018

Conversation

StephanErb
Copy link
Contributor

Profiling indicates a large amount of time is spend in get_installed_version.

install-profile

When printing all installed package versions, the installed set is already fixed and no longer changing. It is therefore safe to reuse a single pkg_resources.WorkingSet for all invocations of get_installed_version.

This yields a small performance improvement:

# Before this patch (hot cache)
$ time pip install "apache-airflow[doc,dask,azure]" --no-compile --ignore-installed --no-warn-conflicts
11.163    

# With this patch (hot cache)
$ time pip install "apache-airflow[doc,dask,azure]" --no-compile --ignore-installed --no-warn-conflicts
8.967

@pradyunsg pradyunsg added the type: enhancement Improvements to functionality label Apr 2, 2018
@pradyunsg pradyunsg added this to the 10.1 milestone Apr 2, 2018
@pradyunsg
Copy link
Member

Hey @StephanErb!

This is an enhancement, and we're currently in a beta phase for pip 10.0. This PR will have to wait until after pip 10.0's full release. I hope you understand, cheers! :)

@StephanErb
Copy link
Contributor Author

I am aware. All good :)

@StephanErb
Copy link
Contributor Author

@pradyunsg just to clarify: Do you plan to land this in 10.0.1 or 10.1.0?

@pradyunsg
Copy link
Member

10.1.0

@pradyunsg
Copy link
Member

pradyunsg commented May 30, 2018

@StephanErb How did you generate that chart?

aside: 10.1.0 -> 18.0 since we've changed our versioning scheme. :)

@StephanErb
Copy link
Contributor Author

@pradyunsg I used the vmprof profiler to look for bottlenecks (https://vmprof.readthedocs.io/en/latest/). It comes with a commandline output but can can also submit reports to http://vmprof.com/ for graphical analysis. The chart is then simply a screenshot from that page.

@pradyunsg
Copy link
Member

Cool. Thanks. :)

Copy link
Member

@pradyunsg pradyunsg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you update the NEWS fragment to be a bugfix one? This should be something that's mentioned in the NEWS. :)

The installed set of packages is already fixed and no longer changing.
It is therefore safe to reuse a single `pkg_resources.WorkingSet` for
all invocations of `get_installed_version`.
@StephanErb StephanErb force-pushed the fast_install_versions branch from db9809c to 35c1ab2 Compare June 1, 2018 22:22
@StephanErb
Copy link
Contributor Author

Done :)

@pradyunsg pradyunsg requested a review from a team June 7, 2018 14:42
@pradyunsg pradyunsg removed the request for review from a team June 19, 2018 06:50
@pradyunsg pradyunsg merged commit cbc21a5 into pypa:master Jun 19, 2018
@lock
Copy link

lock bot commented Jun 2, 2019

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@lock lock bot added the auto-locked Outdated issues that have been locked by automation label Jun 2, 2019
@lock lock bot locked as resolved and limited conversation to collaborators Jun 2, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
auto-locked Outdated issues that have been locked by automation type: enhancement Improvements to functionality
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants