[issue45661] [meta] Freeze commonly used stdlib modules.

Guido van Rossum report at bugs.python.org
Fri Jan 7 15:05:59 EST 2022


Guido van Rossum <guido at python.org> added the comment:

Deep-freezing is definitely not a miracle cure. We should continue to trim or delay unneeded imports (like Christian just did for setuptools' _distutils_hack).

What *would* be a miracle cure would be if we could deep-freeze the module contents after it has *executed*. But that is much harder in general, since two executions (even on the same platform) could result in different module contents (e.g. conditionally defining something based on environment contents).

Instagram's Cinder has something that works for this, strict modules (https://github.com/facebookincubator/cinder#strict-modules). It is a complex system! But if we could do this it could really speed up a lot of imports tremendously. (Though still at the cost of binary size increase.)

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45661>
_______________________________________


More information about the Python-bugs-list mailing list