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

Improve performance by replacing call to pip freeze with import of do… #5320

Closed

Conversation

garribas
Copy link

…cker.version_info (fixes #5038)

Replaced call to pip freeze with a python one-liner that imports docker.version_info. Version 1.10.6 was the latest release of docker python client released as docker-py. This change results in executions of docker-compose being about 1.5x faster (affects all commands: help, info, etc.)

With call to pip freeze:

$ time docker-compose

real 0m1.033s
user 0m0.894s
sys 0m0.130s

With call to import docker.version_info:

$ time docker-compose

real 0m0.676s
user 0m0.568s
sys 0m0.085s

Signed-off-by: Guillermo Arribas garribas@gmail.com

…cker.version_info (fixes docker#5038)

Signed-off-by: Guillermo Arribas <garribas@gmail.com>
@shin-
Copy link

shin- commented Nov 28, 2017

Unfortunately, I don't think that will work reliably when both docker and docker-py are installed, which was the issue in the first place.

@garribas garribas closed this Nov 29, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Improve performance by avoiding to call "pip freeze"
2 participants