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 import times and runtimes #2485

Merged
merged 11 commits into from Jul 1, 2018

Conversation

Projects
None yet
2 participants
@techalchemy
Member

techalchemy commented Jul 1, 2018

  • Lazily import requirementslib
  • Fixes #2843

Signed-off-by: Dan Ryan dan@danryan.co

@techalchemy

This comment has been minimized.

Member

techalchemy commented Jul 1, 2018

Before PR:

 ~/g/pypa-pipenv       time -p pipenv --venv
/home/hawk/.virtualenvs/pypa-pipenv-PuUpLSqX
real 0.93
user 0.84
sys 0.08

After PR:

 ~/g/pypa-pipenv   import-time-improvement     
/home/hawk/.virtualenvs/pypa-pipenv-PuUpLSqX
real 0.31
user 0.26
sys 0.04

techalchemy added some commits Jul 1, 2018

Improve import times and runtimes
- Lazily import requirementslib

Signed-off-by: Dan Ryan <dan@danryan.co>
More improvements
Signed-off-by: Dan Ryan <dan@danryan.co>
Reimplement `get_workon_home` to save import
- Pew import is super expensive
- Fixes #2843

Signed-off-by: Dan Ryan <dan@danryan.co>
Add missed import
Signed-off-by: Dan Ryan <dan@danryan.co>
Add additional comparison for markers
Signed-off-by: Dan Ryan <dan@danryan.co>

@techalchemy techalchemy force-pushed the import-time-improvement branch from f45e72a to 547110b Jul 1, 2018

@techalchemy techalchemy added this to the 2018.7.0 milestone Jul 1, 2018

@@ -139,6 +132,8 @@ def which(command, location=None, allow_global=False):
# Disable warnings for Python 2.6.
if 'urllib3' in globals():
import urllib3
from urllib3.exceptions import InsecureRequestWarning
urllib3.disable_warnings(InsecureRequestWarning)

This comment has been minimized.

@uranusjr

uranusjr Jul 1, 2018

Member

I think this can be eliminated altogether. We don’t support 2.6 anymore.

techalchemy and others added some commits Jul 1, 2018

Use more local tests
Signed-off-by: Dan Ryan <dan@danryan.co>

@techalchemy techalchemy merged commit ebaadfc into master Jul 1, 2018

3 checks passed

VSTS: pipenv-Python Package-CI 20180701.5 succeeded
Details
buildkite/pipenv Build #687 passed (9 minutes, 54 seconds)
Details
continuous-integration/appveyor/pr AppVeyor build succeeded
Details

@techalchemy techalchemy deleted the import-time-improvement branch Jul 1, 2018

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