Message297780
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. |
|
Date |
User |
Action |
Args |
2017-07-05 20:30:30 | eric.snow | set | recipients:
+ eric.snow, ncoghlan, vstinner, yselivanov |
2017-07-05 20:30:30 | eric.snow | set | messageid: <1499286630.32.0.878971862649.issue30860@psf.upfronthosting.co.za> |
2017-07-05 20:30:30 | eric.snow | link | issue30860 messages |
2017-07-05 20:30:30 | eric.snow | create | |
|