Skip to content

Python 3.12 Goals

Michael Droettboom edited this page Aug 2, 2022 · 8 revisions

WIP

This is a short summary of the major themes of work that the Faster CPython plans to land in 3.12.

Tracing optimizer

While the speed improvements in 3.11 were mainly concerned with replacing polymorphic opcodes with faster context-specific ones (adaptive opcode specialization), the next big set of improvements will come from optimizing traces of multiple opcodes. To enable this, many of the existing high-level opcodes will be replaced with lower-level opcodes, for example for reference counting. These simpler opcodes will have more opportunities for optimizations, for example, removing unnecessary reference count operations. These lower-level opcodes also put us closer to a set of instructions suitable for machine code generation in the future (both in CPython and third-party projects).

Per-interpreter GIL

More specializations

Reduce the overhead of reference counting

Smaller object structs

Code quality and stability

In addition to the above the team is working in the following ongoing areas:

  • Proactively monitoring code coverage of the CPython test suite, particularly at the C level. Increasing robustness of the test suite so we can more confidently make the changes we plan to make.
  • Improving the pyperformance benchmarking suite to include more representative workloads.
  • Assisting with CPython issues and PRs with the "performance" label.
  • Increasing our set of standard benchmarking machines and results to include macOS and Windows.
  • Continuing to collaborate with major projects that make use of Python internals to help them port their code to changes in the CPython interpreter. This includes Cython, greenlets, coverage, pybind11 and others.
Clone this wiki locally