bpo-45020: Freeze the modules imported during startup.#28107
Closed
ericsnowcurrently wants to merge 61 commits intopython:mainfrom
Closed
bpo-45020: Freeze the modules imported during startup.#28107ericsnowcurrently wants to merge 61 commits intopython:mainfrom
ericsnowcurrently wants to merge 61 commits intopython:mainfrom
Conversation
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
[I'm going to split this PR up.]
Doing this provides some significant performance gains for runtime startup. This change also adds a command-line flag (
-X frozen_modules=[on|off]) that allows users to opt out of (or into) using frozen modules. When run in a development environment it defaults to opting out, to avoid contributors wasting time trying to figure out why their changes aren't getting used.Note that I plan on updating the tests for the frozen modules so they run against the frozen and unfrozen modules, like we do with importlib. We'll also be looking at making frozen modules more like source modules in a separate PR.
There are only a handful of things left to do here before this could be merged:
get the "check_generated_files" job passingsort out PyConfig.stdlib_dir on Windowshttps://bugs.python.org/issue45020