| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -618,6 +618,16 @@ also be used to improve performance. | |||
| 618 | 618 | Enable computed gotos in evaluation loop (enabled by default on supported | |
| 619 | 619 | compilers). | |
| 620 | 620 | ||
| 621 | + .. option:: --with-tail-call-interp | ||
| 622 | + | ||
| 623 | + Enable interpreters using tail calls in CPython. If enabled, enabling PGO | ||
| 624 | + (:option:`--enable-optimizations`) is highly recommended. This option specifically | ||
| 625 | + requires a C compiler with proper tail call support, and the | ||
| 626 | + `preserve_none <https://clang.llvm.org/docs/AttributeReference.html#preserve-none>`_ | ||
| 627 | + calling convention. For example, Clang 19 and newer supports this feature. | ||
| 628 | + | ||
| 629 | + .. versionadded:: next | ||
| 630 | + | ||
| 621 | 631 | .. option:: --without-mimalloc | |
| 622 | 632 | ||
| 623 | 633 | Disable the fast :ref:`mimalloc <mimalloc>` allocator | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -68,6 +68,7 @@ Summary -- release highlights | |||
| 68 | 68 | * :ref:`PEP 649: deferred evaluation of annotations <whatsnew314-pep649>` | |
| 69 | 69 | * :ref:`PEP 741: Python Configuration C API <whatsnew314-pep741>` | |
| 70 | 70 | * :ref:`PEP 761: Discontinuation of PGP signatures <whatsnew314-pep761>` | |
| 71 | + * :ref:`A new tail-calling interpreter <whatsnew314-tail-call>` | ||
| 71 | 72 | ||
| 72 | 73 | ||
| 73 | 74 | New features | |
@@ -208,6 +209,30 @@ configuration mechanisms). | |||
| 208 | 209 | .. seealso:: | |
| 209 | 210 | :pep:`741`. | |
| 210 | 211 | ||
| 212 | + .. _whatsnew314-tail-call: | ||
| 213 | + | ||
| 214 | + A new tail-calling interpreter | ||
| 215 | + ------------------------------ | ||
| 216 | + | ||
| 217 | + A new type of interpreter based on tail calls has been added to CPython. | ||
| 218 | + For certain newer compilers, this interpreter provides | ||
| 219 | + significantly better performance. Preliminary numbers on our machines suggest | ||
| 220 | + anywhere from -3% to 30% faster Python code, and a geometric mean of 9-15% | ||
| 221 | + faster on ``pyperformance`` depending on platform and architecture. | ||
| 222 | + | ||
| 223 | + This interpreter currently only works with Clang 19 and newer | ||
| 224 | + on x86-64 and AArch64 architectures. However, we expect | ||
| 225 | + that a future release of GCC will support this as well. | ||
| 226 | + | ||
| 227 | + This feature is opt-in for now. We highly recommend enabling profile-guided | ||
| 228 | + optimization with the new interpreter as it is the only configuration we have | ||
| 229 | + tested and can validate its improved performance. | ||
| 230 | + For further information on how to build Python, see | ||
| 231 | + :option:`--with-tail-call-interp`. | ||
| 232 | + | ||
| 233 | + (Contributed by Ken Jin in :gh:`128718`, with ideas on how to implement this | ||
| 234 | + in CPython by Mark Shannon, Garret Gu, Haoran Xu, and Josh Haberman.) | ||
| 235 | + | ||
| 211 | 236 | ||
| 212 | 237 | Other language changes | |
| 213 | 238 | ====================== | |
| Back | FazBrowse Home | New Git URL |
0 commit comments