From a8f8d5b4bd30dbe0828550469d98f12d2ebb2ef4 Mon Sep 17 00:00:00 2001 From: INADA Naoki Date: Thu, 29 Jun 2017 00:31:53 +0900 Subject: bpo-29585: optimize site.py startup time (GH-136) Avoid importing `sysconfig` from `site` by copying minimum code. Python startup is 5% faster on Linux and 30% faster on macOS --- Python/sysmodule.c | 1 + 1 file changed, 1 insertion(+) (limited to 'Python/sysmodule.c') diff --git a/Python/sysmodule.c b/Python/sysmodule.c index 424a88f7086..84673e3fed9 100644 --- a/Python/sysmodule.c +++ b/Python/sysmodule.c @@ -1965,6 +1965,7 @@ _PySys_BeginInit(void) SET_SYS_FROM_STRING("_git", Py_BuildValue("(szz)", "CPython", _Py_gitidentifier(), _Py_gitversion())); + SET_SYS_FROM_STRING("_framework", PyUnicode_FromString(PYTHONFRAMEWORK)); SET_SYS_FROM_STRING("api_version", PyLong_FromLong(PYTHON_API_VERSION)); SET_SYS_FROM_STRING("copyright", -- cgit v1.2.3