This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author eric.snow
Recipients eric.snow, ncoghlan, vstinner, yselivanov
Date 2017-07-05.20:30:30
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1499286630.32.0.878971862649.issue30860@psf.upfronthosting.co.za>
In-reply-to
Content
CPython's C code makes extensive use of global variables.  The globals fall into one of several categories:

* (effectively) constants (incl. static types)
* freelists, caches, and counters
* used exclusively in main or in REPL
* process-global state
* module state
* Python runtime state

Those in the last category are not explicitly organized nor easily discoverable.  Among other things, this has an impact on efforts that change the runtime (e.g. my multi-core Python project).  To improve the situation I'd like to do the following:

1. group the (stateful) runtime globals into various topical structs
2. consolidate the topical structs under a single top-level _PyRuntimeState struct
3. add a check-c-globals.py script that helps identify runtime globals

One side effect of consolidating these globals is a significant performance improvement of CPython.  Presumably this is due to the caching behavior of a single struct vs. that of dozens of separate globals.

I have a patch and will put up a PR momentarily.
History
Date User Action Args
2017-07-05 20:30:30eric.snowsetrecipients: + eric.snow, ncoghlan, vstinner, yselivanov
2017-07-05 20:30:30eric.snowsetmessageid: <1499286630.32.0.878971862649.issue30860@psf.upfronthosting.co.za>
2017-07-05 20:30:30eric.snowlinkissue30860 messages
2017-07-05 20:30:30eric.snowcreate