cpython/Doc/using
Victor Stinner a0773b89df
gh-108753: Enhance pystats (#108754)
Statistics gathering is now off by default. Use the "-X pystats"
command line option or set the new PYTHONSTATS environment variable
to 1 to turn statistics gathering on at Python startup.

Statistics are no longer dumped at exit if statistics gathering was
off or statistics have been cleared.

Changes:

* Add PYTHONSTATS environment variable.
* sys._stats_dump() now returns False if statistics are not dumped
  because they are all equal to zero.
* Add PyConfig._pystats member.
* Add tests on sys functions and on setting PyConfig._pystats to 1.
* Add Include/cpython/pystats.h and Include/internal/pycore_pystats.h
  header files.
* Rename '_py_stats' variable to '_Py_stats'.
* Exclude Include/cpython/pystats.h from the Py_LIMITED_API.
* Move pystats.h include from object.h to Python.h.
* Add _Py_StatsOn() and _Py_StatsOff() functions. Remove
  '_py_stats_struct' variable from the API: make it static in
  specialize.c.
* Document API in Include/pystats.h and Include/cpython/pystats.h.
* Complete pystats documentation in Doc/using/configure.rst.
* Don't write "all zeros" stats: if _stats_off() and _stats_clear()
  or _stats_dump() were called.
* _PyEval_Fini() now always call _Py_PrintSpecializationStats() which
  does nothing if stats are all zeros.

Co-authored-by: Michael Droettboom <mdboom@gmail.com>
2023-09-06 15:54:59 +00:00
..
cmdline.rst GH-92584: Remove Installing Python Modules (Distutils version) (#108020) 2023-08-16 21:06:56 +00:00
configure.rst gh-108753: Enhance pystats (#108754) 2023-09-06 15:54:59 +00:00
editors.rst bpo-37610: improve Using Python doc wrt Editors & IDE (GH-14850) 2019-07-18 18:23:17 -07:00
index.rst bpo-43774: Document configure options (GH-25283) 2021-04-08 22:32:21 +02:00
mac.rst GH-92584: Redirect macOS package installation to the PPUG (#108044) 2023-08-16 20:42:23 +00:00
unix.rst DOC: remove reference to OpenSolaris (#102671) 2023-04-25 10:45:18 +00:00
venv-create.inc gh-95299: Stop installing setuptools as a part of ensurepip and venv (#101039) 2023-04-17 23:43:34 -05:00
win_installer.png Optimize images by IMGbot (GH-21348) 2022-02-04 15:49:43 +09:00
windows.rst GH-92584: Remove reference to Distutils in `cx_Freeze`'s description (#108047) 2023-08-16 22:23:12 +02:00