shiv icon indicating copy to clipboard operation
shiv copied to clipboard

Slow run when large pyz file

Open sdementen opened this issue 3 years ago • 1 comments

I have "shived" all my dependencies (pandas, scipy, ...) to end up with a compressed .pyz file of close to 200MB. My entry point is a function that does not import anything but modules from the sdlib (sys, pathlib) and runs immediately when run outside the shiv file. However, when I run the shiv file, it takes 16s to run (once it has already been decompressed in the .shiv folder, for the first run, it takes 82s to decompress to ~600 MB and run) Is there some way to improve this performance ? Is the .pyz file completely read from disk & uncompressed each time the pyz file is run (even if it is only to check it has already been decompressed in the .shiv folder) ? If so, would it make sense to split the file in two file, a small .pyz with the bootstrap logic (check .shiv/... folder is updated, run preamble,...) and a large file with the zipped site-packages that would only be accessed if there is a need to decompress for the first time to the .shiv folder ?

sdementen avatar Feb 09 '22 05:02 sdementen

Thankfully my performance difference is a little smaller (0.6s vs 0.1s) but since it's a CLI utility which we execute a lot, it is certainly noticeable.

fquinner avatar Apr 08 '22 07:04 fquinner