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

Cache pip.pex. #937

Merged
merged 1 commit into from
Mar 30, 2020
Merged

Cache pip.pex. #937

merged 1 commit into from
Mar 30, 2020

Conversation

jsirois
Copy link
Member

@jsirois jsirois commented Mar 30, 2020

Previously, the pip.pex was re-created once per Pex CLI run. Now it is
created once per unique Pex distribution.

Perf result difference for a single distribution PEX indicates this
shaves off ~600ms of overhead for a warm cache (after the 1st run of the
Pex CLI at a given version):

Before (Pex 2.1.7):

$ multitime -s 2 -n 10 python -m pex psutil -o psutil.pex
===> multitime results
1: /home/jsirois/.venv/pex1.6/bin/pex psutil -o psutil.pex
            Mean        Std.Dev.    Min         Median      Max
real        2.044       0.008       2.030       2.046       2.060
user        1.690       0.038       1.636       1.700       1.751
sys         0.220       0.039       0.164       0.210       0.273

After:

$ multitime -s 2 -n 10 python -m pex psutil -o psutil.pex
===> multitime results
1: python -m pex psutil -o psutil.pex
            Mean        Std.Dev.    Min         Median      Max
real        1.365       0.070       1.328       1.339       1.571
user        1.070       0.019       1.030       1.074       1.105
sys         0.139       0.015       0.116       0.137       0.170

Previously, the pip.pex was re-created once per Pex CLI run. Now it is
created once per unique Pex distribution.

Perf result difference for a single distribution PEX indicates this
shaves off ~600ms of overhead for a warm cache (after the 1st run of the
Pex CLI at a given version):

Before (Pex 2.1.7):
```
$ multitime -s 2 -n 10 python -m pex psutil -o psutil.pex
===> multitime results
1: /home/jsirois/.venv/pex1.6/bin/pex psutil -o psutil.pex
            Mean        Std.Dev.    Min         Median      Max
real        2.044       0.008       2.030       2.046       2.060
user        1.690       0.038       1.636       1.700       1.751
sys         0.220       0.039       0.164       0.210       0.273
```

After:
```
$ multitime -s 2 -n 10 python -m pex psutil -o psutil.pex
===> multitime results
1: python -m pex psutil -o psutil.pex
            Mean        Std.Dev.    Min         Median      Max
real        1.365       0.070       1.328       1.339       1.571
user        1.070       0.019       1.030       1.074       1.105
sys         0.139       0.015       0.116       0.137       0.170
```
@jsirois jsirois mentioned this pull request Mar 30, 2020
4 tasks
Copy link
Contributor

@cosmicexplorer cosmicexplorer left a comment

Choose a reason for hiding this comment

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

This is awesome!!! I really like the isolated() API.

@jsirois jsirois merged commit 160babc into pex-tool:master Mar 30, 2020
@jsirois jsirois deleted the pip.pex/cache branch March 30, 2020 23:39
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.

None yet

3 participants