File tree Expand file tree Collapse file tree 2 files changed +9
-3
lines changed
Misc/NEWS.d/next/Core and Builtins Expand file tree Collapse file tree 2 files changed +9
-3
lines changed Original file line number Diff line number Diff line change 1
1
Freeze all the modules that are imported during Python startup. This gives
2
2
us meaningful performance improvements to startup. Also add a new command
3
3
line option, "-X frozen_modules=[on|off]" to opt out of (or into) using
4
- frozen modules. This defaults to "on".
4
+ frozen modules. This defaults to "on" (or "off" if it's a debug build) .
Original file line number Diff line number Diff line change @@ -2123,9 +2123,15 @@ _PyConfig_InitImportConfig(PyConfig *config)
2123
2123
/* -X frozen_modules=[on|off] */
2124
2124
const wchar_t * value = config_get_xoption_value (config , L"frozen_modules" );
2125
2125
if (value == NULL ) {
2126
- // Use a meaningful default.
2127
- // XXX Add the logic.
2126
+ // Use a meaningful default:
2127
+ // * "off" for core development (running in a local repo)
2128
+ // * "on" otherwise (e.g. for release builds)
2129
+ #ifdef Py_DEBUG
2130
+ // For now, Py_DEBUG is an adequate approximation of core development.
2128
2131
config -> use_frozen_modules = false;
2132
+ #else
2133
+ config -> use_frozen_modules = true;
2134
+ #endif
2129
2135
}
2130
2136
else if (wcscmp (value , L"on" ) == 0 ) {
2131
2137
config -> use_frozen_modules = true;
You can’t perform that action at this time.
0 commit comments