-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Avoid repeatedly invoking pip show
in Python lang host
#7819
Conversation
PR is now waiting for a maintainer to run the acceptance tests. Note for the maintainer: To run the acceptance tests, please comment /run-acceptance-tests on the PR Further commands available:
|
PR is now waiting for a maintainer to run the acceptance tests. Note for the maintainer: To run the acceptance tests, please comment /run-acceptance-tests on the PR Further commands available:
|
The Python language host invokes `pip show` for each Pulumi package in a project at startup. But `pip show` is quite slow in large projects: it takes 2+ seconds per invocation in a project at @MaterializeInc. `pip show` is invoked to compute the installed location of each plugin package. But it turns out `pip list` takes a `-v` flag that can supply this information in one shot, avoiding the need to ever invoke `pip show`. This patch shaves about 20s off our boot time for `pulumi up`. (There's probably a separate bug in Pip that causes `pip show` to be so slow, because `pip list` is an order of magnitude faster and does a lot more work, but I didn't bother tracking that down.)
PR is now waiting for a maintainer to run the acceptance tests. Note for the maintainer: To run the acceptance tests, please comment /run-acceptance-tests on the PR Further commands available:
|
/run-acceptance-tests |
Please view the results of the PR Build + Acceptance Tests Run Here |
There are some false test failures (lint is currently broken on master, I'm fixing separately), but there is at least one test failure that is pertinent to this PR:
I'll investigate further tomorrow, hopefully a simple fix. |
Merged via #7831 Thank you very very much. This is a fix that makes me personally quite excited. |
Thanks very much for fixing that test failure! The non-JSON trailer was a great catch. We're very excited for the impending speedup to our |
Description
The Python language host invokes
pip show
for each Pulumi package in aproject at startup. But
pip show
is quite slow in large projects: ittakes 2+ seconds per invocation in a project at @MaterializeInc.
pip show
is invoked to compute the installed location of each pluginpackage. But it turns out
pip list
takes a-v
flag that can supplythis information in one shot, avoiding the need to ever invoke
pip show
.This patch shaves about 20s off our boot time for
pulumi up
.(There's probably a separate bug in Pip that causes
pip show
to be soslow, because
pip list
is an order of magnitude faster and does a lotmore work, but I didn't bother tracking that down.)
Checklist
Seems hard to write a test for. If the existing tests pass then this at least didn't break anything.
Are perf improvements like this usually noted in the changelog?
Nope.