summaryrefslogtreecommitdiffstats
path: root/Makefile.pre.in
diff options
context:
space:
mode:
authorEric Snow <ericsnowcurrently@gmail.com>2021-09-15 16:19:30 (GMT)
committerGitHub <noreply@github.com>2021-09-15 16:19:30 (GMT)
commitcbeb81971057d6c382f45ecce92df2b204d4106a (patch)
tree98b66700b6ca5d81c863eb0b72bee6e8e38d91ca /Makefile.pre.in
parent1a9ef5798525bbb39a16c8af5c435b97352ee027 (diff)
downloadcpython-cbeb81971057d6c382f45ecce92df2b204d4106a.zip
cpython-cbeb81971057d6c382f45ecce92df2b204d4106a.tar.gz
cpython-cbeb81971057d6c382f45ecce92df2b204d4106a.tar.bz2
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
Diffstat (limited to 'Makefile.pre.in')
-rw-r--r--Makefile.pre.in48
1 files changed, 36 insertions, 12 deletions
diff --git a/Makefile.pre.in b/Makefile.pre.in
index e7005be..b2a8f0e 100644
--- a/Makefile.pre.in
+++ b/Makefile.pre.in
@@ -751,24 +751,40 @@ regen-frozen: Tools/scripts/freeze_modules.py $(FROZEN_FILES)
# BEGIN: freezing modules
Python/frozen_modules/importlib__bootstrap.h: Programs/_freeze_module Lib/importlib/_bootstrap.py
- $(srcdir)/Programs/_freeze_module importlib._bootstrap \
- $(srcdir)/Lib/importlib/_bootstrap.py \
- $(srcdir)/Python/frozen_modules/importlib__bootstrap.h
+ $(srcdir)/Programs/_freeze_module importlib._bootstrap $(srcdir)/Lib/importlib/_bootstrap.py $(srcdir)/Python/frozen_modules/importlib__bootstrap.h
Python/frozen_modules/importlib__bootstrap_external.h: Programs/_freeze_module Lib/importlib/_bootstrap_external.py
- $(srcdir)/Programs/_freeze_module importlib._bootstrap_external \
- $(srcdir)/Lib/importlib/_bootstrap_external.py \
- $(srcdir)/Python/frozen_modules/importlib__bootstrap_external.h
+ $(srcdir)/Programs/_freeze_module importlib._bootstrap_external $(srcdir)/Lib/importlib/_bootstrap_external.py $(srcdir)/Python/frozen_modules/importlib__bootstrap_external.h
Python/frozen_modules/zipimport.h: Programs/_freeze_module Lib/zipimport.py
- $(srcdir)/Programs/_freeze_module zipimport \
- $(srcdir)/Lib/zipimport.py \
- $(srcdir)/Python/frozen_modules/zipimport.h
+ $(srcdir)/Programs/_freeze_module zipimport $(srcdir)/Lib/zipimport.py $(srcdir)/Python/frozen_modules/zipimport.h
+
+Python/frozen_modules/abc.h: Programs/_freeze_module Lib/abc.py
+ $(srcdir)/Programs/_freeze_module abc $(srcdir)/Lib/abc.py $(srcdir)/Python/frozen_modules/abc.h
+
+Python/frozen_modules/io.h: Programs/_freeze_module Lib/io.py
+ $(srcdir)/Programs/_freeze_module io $(srcdir)/Lib/io.py $(srcdir)/Python/frozen_modules/io.h
+
+Python/frozen_modules/_collections_abc.h: Programs/_freeze_module Lib/_collections_abc.py
+ $(srcdir)/Programs/_freeze_module _collections_abc $(srcdir)/Lib/_collections_abc.py $(srcdir)/Python/frozen_modules/_collections_abc.h
+
+Python/frozen_modules/_sitebuiltins.h: Programs/_freeze_module Lib/_sitebuiltins.py
+ $(srcdir)/Programs/_freeze_module _sitebuiltins $(srcdir)/Lib/_sitebuiltins.py $(srcdir)/Python/frozen_modules/_sitebuiltins.h
+
+Python/frozen_modules/genericpath.h: Programs/_freeze_module Lib/genericpath.py
+ $(srcdir)/Programs/_freeze_module genericpath $(srcdir)/Lib/genericpath.py $(srcdir)/Python/frozen_modules/genericpath.h
+
+Python/frozen_modules/ntpath.h: Programs/_freeze_module Lib/ntpath.py
+ $(srcdir)/Programs/_freeze_module ntpath $(srcdir)/Lib/ntpath.py $(srcdir)/Python/frozen_modules/ntpath.h
+
+Python/frozen_modules/posixpath.h: Programs/_freeze_module Lib/posixpath.py
+ $(srcdir)/Programs/_freeze_module posixpath $(srcdir)/Lib/posixpath.py $(srcdir)/Python/frozen_modules/posixpath.h
+
+Python/frozen_modules/stat.h: Programs/_freeze_module Lib/stat.py
+ $(srcdir)/Programs/_freeze_module stat $(srcdir)/Lib/stat.py $(srcdir)/Python/frozen_modules/stat.h
Python/frozen_modules/hello.h: Programs/_freeze_module Tools/freeze/flag.py
- $(srcdir)/Programs/_freeze_module hello \
- $(srcdir)/Tools/freeze/flag.py \
- $(srcdir)/Python/frozen_modules/hello.h
+ $(srcdir)/Programs/_freeze_module hello $(srcdir)/Tools/freeze/flag.py $(srcdir)/Python/frozen_modules/hello.h
# END: freezing modules
@@ -1006,6 +1022,14 @@ FROZEN_FILES = \
$(srcdir)/Python/frozen_modules/importlib__bootstrap.h \
$(srcdir)/Python/frozen_modules/importlib__bootstrap_external.h \
$(srcdir)/Python/frozen_modules/zipimport.h \
+ $(srcdir)/Python/frozen_modules/abc.h \
+ $(srcdir)/Python/frozen_modules/io.h \
+ $(srcdir)/Python/frozen_modules/_collections_abc.h \
+ $(srcdir)/Python/frozen_modules/_sitebuiltins.h \
+ $(srcdir)/Python/frozen_modules/genericpath.h \
+ $(srcdir)/Python/frozen_modules/ntpath.h \
+ $(srcdir)/Python/frozen_modules/posixpath.h \
+ $(srcdir)/Python/frozen_modules/stat.h \
$(srcdir)/Python/frozen_modules/hello.h
# End FROZEN_FILES