Speed Improvements in CPython 3.11: Faster Interpreter, Adaptive Bytecode, and Upcoming JIT
The article explains how CPython 3.11 achieves a 1.25‑times speed boost over 3.10 through a new adaptive bytecode interpreter, outlines the goals of the Faster‑CPython project and PEP 659, and discusses the planned JIT compiler for future Python releases.
Python is praised for its ease of use and extensive data‑science libraries, but its execution speed has long been a drawback.
At PyCon US 2021, Guido van Rossum announced a goal to double Python’s speed in version 3.11 and achieve a five‑fold increase within four years.
Python 3.11 is currently in preview (3.11.0b1) and early tests show it is about 1.25× faster than 3.10.
CPython 3.11 is 1.25× faster than 3.10
Mark Shannon (Core Python developer) presented performance updates at PyCon US 2022, noting that the Faster‑CPython project has measured a 1.25× overall speed gain for the preview build.
The project also introduced a new bytecode interpreter that handles errors more efficiently and implements a specialized, adaptive interpreter as described in PEP 659.
New bytecode interpreter makes error handling more efficient
PEP 659 proposes a specialized, adaptive interpreter that quickly specializes code in a small region and can de‑optimize cheaply, aiming to keep the interpreter fast with minimal warm‑up cost.
This approach should produce a faster CPython interpreter that tracks individual bytecode during execution, though memory usage remains similar to 3.10.
CPython JIT compiler coming soon
Shannon believes an immediate JIT is not a priority; a simple JIT for small regions may appear in Python 3.12, with a more extensive JIT slated for 3.13.
Other projects such as Anaconda’s support for Pyston, the LLVM‑based Numba JIT, and PyPy also aim to accelerate Python, but they target different use cases.
The Faster‑CPython plan (see its GitHub repository) outlines these future JIT enhancements and invites community feedback.
Python Programming Learning Circle
A global community of Chinese Python developers offering technical articles, columns, original video tutorials, and problem sets. Topics include web full‑stack development, web scraping, data analysis, natural language processing, image processing, machine learning, automated testing, DevOps automation, and big data.
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.