melodic-thailand-99227
09/02/2021, 5:04 PMpython_library()
pex_binary(entry_point="main.py", name="bin")
main.py:
print("Hello world")
However running it takes ~2 seconds:
./pants run bins:bin 0.59s user 0.15s system 37% cpu 1.984 total
Am I doing something wrong or should I expect a big penalty from pex binaries?hundreds-father-404
09/02/2021, 5:10 PMmelodic-thailand-99227
09/02/2021, 5:26 PM$ time ./pants --version
2.7.0rc0
real 0m0.832s
user 0m0.549s
sys 0m0.125s
Just running ./pants
gets a hit of 600-900mshundreds-father-404
09/02/2021, 5:36 PMwitty-crayon-22786
09/02/2021, 5:40 PMpants package
to build the binary, and then run the binary independently--venv
mode should be ~as fast as a venv.hundreds-father-404
09/02/2021, 5:43 PMunzip
or venv
. As explained there, venv
will get you the fastest subsequent runs after an initial run