summaryrefslogtreecommitdiff
path: root/Doc/using
diff options
context:
space:
mode:
authorBarry Warsaw <barry@python.org>2017-11-02 16:13:36 -0700
committerGitHub <noreply@github.com>2017-11-02 16:13:36 -0700
commit700d2e4755921d6c339ff20dacecde1aea64de34 (patch)
treece746ff976847c80a63b88a5d6795fa1dd8b7551 /Doc/using
parent9e3397333278f973a11d933c27a69af250e4acf0 (diff)
downloadcpython-git-700d2e4755921d6c339ff20dacecde1aea64de34.tar.gz
bpo-31415: Support PYTHONPROFILEIMPORTTIME envvar equivalent to -X importtime (#4240)
Support PYTHONPROFILEIMPORTTIME envvar equivalent to -X importtime
Diffstat (limited to 'Doc/using')
-rw-r--r--Doc/using/cmdline.rst14
1 files changed, 12 insertions, 2 deletions
diff --git a/Doc/using/cmdline.rst b/Doc/using/cmdline.rst
index 8ab26f5955..310891d6d0 100644
--- a/Doc/using/cmdline.rst
+++ b/Doc/using/cmdline.rst
@@ -411,7 +411,8 @@ Miscellaneous options
* ``-X importtime`` to show how long each import takes. It shows module name,
cumulative time (including nested imports) and self time (exluding nested
imports). Note that its output may be broken in multi threaded application.
- Typical usage is ``python3 -X importtime -c 'import asyncio'``.
+ Typical usage is ``python3 -X importtime -c 'import asyncio'``. See also
+ :envvar:`PYTHONPROFILEIMPORTTIME`.
It also allows passing arbitrary values and retrieving them through the
:data:`sys._xoptions` dictionary.
@@ -429,7 +430,7 @@ Miscellaneous options
The ``-X showalloccount`` option.
.. versionadded:: 3.7
- The ``-X importtime`` option.
+ The ``-X importtime`` and :envvar:`PYTHONPROFILEIMPORTTIME` options.
Options you shouldn't use
@@ -650,6 +651,15 @@ conflict.
.. versionadded:: 3.4
+.. envvar:: PYTHONPROFILEIMPORTTIME
+
+ If this environment variable is set to a non-empty string, Python will
+ show how long each import takes. This is exactly equivalent to setting
+ ``-X importtime`` on the command line.
+
+ .. versionadded:: 3.7
+
+
.. envvar:: PYTHONASYNCIODEBUG
If this environment variable is set to a non-empty string, enable the