[issue45020] Freeze all modules imported during startup.

Neil Schemenauer report at bugs.python.org
Sat Aug 28 01:36:18 EDT 2021


Neil Schemenauer <nas-python at arctrix.com> added the comment:

[Larry]
> The one thing I guess I never mentioned is that building and working with the
> prototype was frightful; it had both Python code and C code, and it was
> fragile and hard to get working.

I took Larry's PR and did a fair amount of cleanup on it to make the build less
painful and fragile.  My branch is fairly easy to re-build.  The major downsides remaining
are that you couldn't update .py files and have them used (static ones
take priority) and the generated C code is quite large.

I didn't make any attempt to work on the serializer, other than to make it work
with an alpha version of Python 3.10.

https://github.com/nascheme/cpython/tree/static_frozen

It was good enough to pass nearly(?) all tests and I did some profiling.  It helped reduce startup time quite a bit.

----------

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


More information about the Python-bugs-list mailing list