> Solution 4: ZIP the entire standard library
> (...)
> Nevertheless, this might (in theory) **save 17.8 MiB / 47 %**.

It's my favorite option. Almost 50% smaller is quite good! It would be
very efficient to have such disk space gain!

Using a ZIP file for the stdlib is commonly suggested solution when
the slow Python startup time is discussed. Python does tons of system
calls to load stdlib modules at startup: many stat() and open() calls.
Having a single large ZIP file allows to do more work in pure
userland.

This solution is well supported by unmodified Python: it's part of the
default sys.path search path:

$ python3
Python 3.7.6 (default, Dec 19 2019, 22:52:49)
>>> import sys; sys.path
['', '/usr/lib64/python37.zip', ...]

It's the second item of sys.path ;-)

I'm ok to discourage users to override *system files* by modifying
them as root. It's too easy to mess up your system this way.

It is easy to extract the ZIP file in your home directory, hack some
files and use PYTHONPATH environment variable to force loading your
modified stdlib.

* faster startup
* less disk space
* harder to mess up your system

Where are drawbacks by the way? ;-)

Victor
_______________________________________________
python-devel mailing list -- python-devel@lists.fedoraproject.org
To unsubscribe send an email to python-devel-le...@lists.fedoraproject.org
Fedora Code of Conduct: 
https://docs.fedoraproject.org/en-US/project/code-of-conduct/
List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives: 
https://lists.fedoraproject.org/archives/list/python-devel@lists.fedoraproject.org

Reply via email to