
‘Tail-call-compiled’ interpreter
The CPython interpreter in Python 3.14 can use a feature in C code that uses tail calls between functions. When compiled with a C compiler that supports these features, CPython runs slightly faster. Note that this feature isn’t the same thing as enabling tail call optimizations in the Python language; it is an internal optimization for the CPython interpreter. Python developers don’t need to do anything except upgrade to Python 3.14 to see a benefit.
Unfortunately, the original estimated performance improvements for this change turned out to be wildly off, due to a compiler bug in Clang/LLVM19 (since fixed in subsequent releases). The performance improvement falls in the range of 3% and 5%, well short of the 9% to 15% speedup originally reported. As with any optimization like this, you’ll want to run your own benchmarks to see how well your applications perform.
Incremental garbage collection
The CPython garbage collector has been reworked to use incremental collection for better performance. Previously, objects could be tracked in up to three different generations for garbage collection, depending on how long they lived. Now the garbage collector only uses two generations, “young” and “old.” Each sweep of the garbage collector processes the whole of the young generation and a portion of the old generation. The net effect is far shorter garbage collection pauses, sometimes down to as little as one-tenth of what they used to be.
asyncio introspection features
Inspecting the runtime behavior of asynchronous tasks has never been easy. Python now has a command-line function, python -m asyncio ps <process_id>
, that allows you to inspect a running Python program by its interpreter process ID and reveal information about its currently executing asyncio
tasks. A major advantage of this feature is that it does not require you to add any instrumentation to the program being inspected, or to stop the running program to add inspection code. You can obtain this from any currently running Python 3.14 program.
Emscripten is now an officially supported platform for Python
Emscripten compiles C/C++ code into WebAssembly, and has been used to port many programs from many ecosystems to the Wasm runtime. The Rust language, for instance, targets Wasm by way of Emscripten. With PEP 776, Python now supports Emscripten as a “Tier 3” platform, alongside Apple iOS on Arm64 and Android on x86-64. This means that Python on Emscripten/Wasm has a reliable automated build system and at least one core developer supporting the platform going forward. It also means that any failure to build on this platform will not block releases going forward. In short, Wasm may not fully support all the features found on other platforms, but Python 3.14 adds support for some libraries that were previously unsupported, such as ctypes
.