You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Avoid parsing pyconfig.h and Makefile by autogenerating extension module #54087
This is splitting one concern from bug 9807 - specifically to avoid parsing pyconfig.h and Makefile in the sysconfig module by autogenerating an extension module (e.g. _sysconfig.c) at build time and using that to get the variables from those two files.
"avoid parsing pyconfig.h and Makefile in the sysconfig module by autogenerating an extension module"
This feature will be appreciated by small devices embeding Python: on such device, headers and Makefile are not copied to not waste disk space.
To me, it is also an horrible thing to parse pyconfig.h and Makefile at startup, because these files are non trivial to parse and it should be done only once. Because these files are created one, we should parse them once, when Python is compiled. So an "autogenerating an extension module" is an excellent idea. It will speed up Python startup.
I wouldn’t call this a performance issue. From bpo-4359, you can see that the two main reasons are first to avoid breakage on platforms that put pyconfig.h and Makefile in another package than the interpreter, and most importantly than the code is hard to maintain. Resource usage diminution will just be a nice side-effect.
Activity
warsaw commentedon Sep 16, 2010
This is splitting one concern from bug 9807 - specifically to avoid parsing pyconfig.h and Makefile in the sysconfig module by autogenerating an extension module (e.g. _sysconfig.c) at build time and using that to get the variables from those two files.
warsaw commentedon Sep 16, 2010
See bpo-9807
voidspace commentedon Feb 24, 2011
And also bpo-10764. This issue affects alternative implementations of Python.
vstinner commentedon Aug 20, 2011
"avoid parsing pyconfig.h and Makefile in the sysconfig module by autogenerating an extension module"
This feature will be appreciated by small devices embeding Python: on such device, headers and Makefile are not copied to not waste disk space.
To me, it is also an horrible thing to parse pyconfig.h and Makefile at startup, because these files are non trivial to parse and it should be done only once. Because these files are created one, we should parse them once, when Python is compiled. So an "autogenerating an extension module" is an excellent idea. It will speed up Python startup.
merwok commentedon Aug 21, 2011
I wouldn’t call this a performance issue. From bpo-4359, you can see that the two main reasons are first to avoid breakage on platforms that put pyconfig.h and Makefile in another package than the interpreter, and most importantly than the code is hard to maintain. Resource usage diminution will just be a nice side-effect.
warsaw commentedon Nov 11, 2013
Isn't this already fixed? We have _sysconfigdata for this now.
warsaw commentedon Nov 18, 2013
I believe this has been fixed for a while.