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

Support an unzip toggle for PEXes. #939

Merged
merged 1 commit into from
Mar 31, 2020

Conversation

jsirois
Copy link
Member

@jsirois jsirois commented Mar 31, 2020

This adds a PexInfo.unzip toggle and --unzip --no-unzip in the
CLI to mark a PEX file that should be unzipped before execution.
Combined with a stable PEX_ROOT cache, this can offer improved startup
latency in both cold and hot cases.

Work towards #930.

This adds a `PexInfo.unzip` toggle and `--unzip` `--no-unzip` in the
CLI to mark a PEX file that should be unzipped before execution.
Combined with a stable PEX_ROOT cache, this can offer improved startup
latency in both cold and hot cases.

Work towards pex-tool#930.
@jsirois
Copy link
Member Author

jsirois commented Mar 31, 2020

Using @illicitonion's benchmark in #930

Baseline old pex:

$ multitime -n20 ./trivial.pex >/dev/null
===> multitime results
1: ./trivial-slow.pex
            Mean        Std.Dev.    Min         Median      Max
real        0.422       0.007       0.414       0.419       0.440       
user        0.383       0.011       0.365       0.383       0.406       
sys         0.035       0.010       0.017       0.036       0.053

For the warm cache case goes down to:

$ multitime -n20 ./trivial.pex >/dev/null
===> multitime results
1: ./trivial.pex
            Mean        Std.Dev.    Min         Median      Max
real        0.263       0.004       0.255       0.263       0.272       
user        0.230       0.009       0.201       0.230       0.244       
sys         0.032       0.010       0.017       0.030       0.060       

But even the cold case becomes faster:

$ PEX_ROOT=/tmp/cache multitime -n20 -r 'rm -rf /tmp/cache' ./trivial.pex >/dev/null
===> multitime results
1: -r "rm -rf /tmp/cache" ./trivial.pex
            Mean        Std.Dev.    Min         Median      Max
real        0.367       0.003       0.359       0.367       0.373       
user        0.328       0.009       0.305       0.328       0.345       
sys         0.038       0.008       0.023       0.036       0.053      

@jsirois jsirois mentioned this pull request Mar 31, 2020
4 tasks
Copy link
Contributor

@Eric-Arellano Eric-Arellano left a comment

Choose a reason for hiding this comment

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

Great results!

@jsirois jsirois merged commit 4af9d13 into pex-tool:master Mar 31, 2020
@jsirois jsirois deleted the issues/930/unzip-cache branch March 31, 2020 23:11
@illicitonion
Copy link
Contributor

Very nice! Thanks!!

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

4 participants