8000 GH-113464: Add the JIT to What's New (GH-133486) · python/cpython@57c9810 · GitHub
[go: up one dir, main page]

Skip to content

Commit 57c9810

Browse files
authored
GH-113464: Add the JIT to What's New (GH-133486)
1 parent dbee142 commit 57c9810

File tree

3 files changed

+49
-11
lines changed

3 files changed

+49
-11
lines changed

Doc/using/configure.rst

Lines changed: 15 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -302,14 +302,21 @@ General Options
302302

303303
.. option:: --enable-experimental-jit=[no|yes|yes-off|interpreter]
304304

305-
Indicate how to integrate the :ref:`JIT compiler <whatsnew313-jit-compiler>`.
306-
307-
* ``no`` - build the interpreter without the JIT.
308-
* ``yes`` - build the interpreter with the JIT.
309-
* ``yes-off`` - build the interpreter with the JIT but disable it by default.
310-
* ``interpreter`` - build the interpreter without the JIT, but with the tier 2 enabled interpreter.
311-
312-
By convention, ``--enable-experimental-jit`` is a shorthand for ``--enable-experimental-jit=yes``.
305+
Indicate how to integrate the :ref:`experimental just-in-time compiler <whatsnew314-jit-compiler>`.
306+
307+
* ``no``: Don't build the JIT.
308+
* ``yes``: Enable the JIT. To disable it at runtime, set the environment
309+
variable :envvar:`PYTHON_JIT=0 <PYTHON_JIT>`.
310+
* ``yes-off``: Build the JIT, but disable it by default. To enable it at
311+
runtime, set the environment variable :envvar:`PYTHON_JIT=1 <PYTHON_JIT>`.
312+
* ``interpreter``: Enable the "JIT interpreter" (only useful for those
313+
debugging the JIT itself). To disable it at runtime, set the environment
314+
variable :envvar:`PYTHON_JIT=0 <PYTHON_JIT>`.
315+
316+
``--enable-experimental-jit=no`` is the default behavior if the option is not
317+
provided, and ``--enable-experimental-jit`` is shorthand for
318+
``--enable-experimental-jit=yes``. See :file:`Tools/jit/README.md` for more
319+
information, including how to install the necessary build-time dependencies.
313320

314321
.. note::
315322

Doc/whatsnew/3.14.rst

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,7 @@ Summary -- release highlights
7777
:ref:`argparse <whatsnew314-color-argparse>`,
7878
:ref:`json <whatsnew314-color-json>` and
7979
:ref:`calendar <whatsnew314-color-calendar>` CLIs
80+
* :ref:`Binary releases for the experimental just-in-time compiler <whatsnew314-jit-compiler>`
8081

8182

8283
Incompatible changes
@@ -715,6 +716,36 @@ in the :envvar:`PYTHONSTARTUP` script.
715716
(Contributed by Łukasz Langa in :gh:`131507`.)
716717

717718

719+
.. _whatsnew314-jit-compiler:
720+
721+
Binary releases for the experimental just-in-time compiler
722+
----------------------------------------------------------
723+
724+
The official macOS and Windows release binaries now include an *experimental*
725+
just-in-time (JIT) compiler. Although it is **not** recommended for production
726+
use, it can be tested by setting :envvar:`PYTHON_JIT=1 <PYTHON_JIT>` as an
727+
environment variable. Downstream source builds and redistributors can use the
728+
:option:`--enable-experimental-jit=yes-off` configuration option for similar
729+
behavior.
730+
731+
The JIT is at an early stage and still in active development. As such, the
732+
typical performance impact of enabling it can range from 10% slower to 20%
733+
faster, depending on workload. To aid in testing and evaluation, a set of
734+
introspection functions has been provided in the :data:`sys._jit` namespace.
735+
:func:`sys._jit.is_available` can be used to determine if the current executable
736+
supports JIT compilation, while :func:`sys._jit.is_enabled` can be used to tell
737+
if JIT compilation has been enabled for the current process.
738+
739+
Currently, the most significant missing functionality is that native debuggers
740+
and profilers like ``gdb`` and ``perf`` are unable to unwind through JIT frames
741+
(Python debuggers and profilers, like :mod:`pdb` or :mod:`profile`, continue to
742+
work without modification). Free-threaded builds do not support JIT compilation.
743+
744+
Please report any bugs or major performance regressions that you encounter!
745+
746+
.. seealso:: :pep:`744`
747+
748+
718749
Other language changes
719750
======================
720751

Tools/jit/README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -54,13 +54,13 @@ choco install llvm --version=19.1.0
5454

5555
## Building
5656

57-
For `PCbuild`-based builds, pass the new `--experimental-jit` option to `build.bat`.
57+
For `PCbuild`-based builds, pass the `--experimental-jit` option to `build.bat`.
5858

59-
For all other builds, pass the new `--enable-experimental-jit` option to `configure`.
59+
For all other builds, pass the `--enable-experimental-jit` option to `configure`.
6060

6161
Otherwise, just configure and build as you normally would. Cross-compiling "just works", since the JIT is built for the host platform.
6262

63-
The JIT can also be enabled or disabled using the `PYTHON_JIT` environment variable, even on builds where it is enabled or disabled by default. More details about configuring CPython with the JIT and optional values for `--enable-experimental-jit` can be found [here](https://docs.python.org/dev/whatsnew/3.13.html#experimental-jit-compiler).
63+
The JIT can also be enabled or disabled using the `PYTHON_JIT` environment variable, even on builds where it is enabled or disabled by default. More details about configuring CPython with the JIT and optional values for `--enable-experimental-jit` can be found [here](https://docs.python.org/dev/using/configure.html#cmdoption-enable-experimental-jit).
6464

6565
[^pep-744]: [PEP 744](https://peps.python.org/pep-0744/)
6666

0 commit comments

Comments
 (0)
0