mirror of
https://github.com/python/cpython.git
synced 2025-08-30 05:35:08 +00:00
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
This commit is contained in:
parent
79d37ae979
commit
a8f8d5b4bd
8 changed files with 96 additions and 43 deletions
|
@ -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",
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue