]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
bpo-45020: Freeze some of the modules imported during startup. (gh-28335)
authorEric Snow <ericsnowcurrently@gmail.com>
Wed, 15 Sep 2021 16:19:30 +0000 (10:19 -0600)
committerGitHub <noreply@github.com>
Wed, 15 Sep 2021 16:19:30 +0000 (10:19 -0600)
commitcbeb81971057d6c382f45ecce92df2b204d4106a
tree98b66700b6ca5d81c863eb0b72bee6e8e38d91ca
parent1a9ef5798525bbb39a16c8af5c435b97352ee027
bpo-45020: Freeze some of the modules imported during startup. (gh-28335)

Doing this provides significant performance gains for runtime startup (~15% with all the imported modules frozen). We don't yet freeze all the imported modules because there are a few hiccups in the build systems we need to sort out first. (See bpo-45186 and bpo-45188.)

Note that in PR GH-28320 we added a command-line flag (-X frozen_modules=[on|off]) that allows users to opt out of (or into) using frozen modules. The default is still "off" but we will change it to "on" as soon as we can do it in a way that does not cause contributors pain.

https://bugs.python.org/issue45020
19 files changed:
Lib/test/test_cmd_line_script.py
Lib/test/test_imp.py
Lib/test/test_import/__init__.py
Lib/test/test_pydoc.py
Lib/test/test_threading.py
Lib/test/test_trace.py
Makefile.pre.in
Misc/NEWS.d/next/Build/2021-09-14-10-07-23.bpo-45020._VGGPv.rst [new file with mode: 0644]
Python/frozen.c
Python/frozen_modules/MANIFEST
Python/frozen_modules/_collections_abc.h [new file with mode: 0644]
Python/frozen_modules/_sitebuiltins.h [new file with mode: 0644]
Python/frozen_modules/abc.h [new file with mode: 0644]
Python/frozen_modules/genericpath.h [new file with mode: 0644]
Python/frozen_modules/io.h [new file with mode: 0644]
Python/frozen_modules/ntpath.h [new file with mode: 0644]
Python/frozen_modules/posixpath.h [new file with mode: 0644]
Python/frozen_modules/stat.h [new file with mode: 0644]
Tools/scripts/freeze_modules.py