Guido van Rossum aims to achieve 3.11x performance increase in CPython XNUMX

Guido van Rossum, the creator of the Python programming language, in his report at the Python Language Summit conference, spoke about plans to optimize the performance of CPython. By version 3.11, which is expected in 2022, the developers hope to achieve a twofold increase in performance. The CPython optimization project is run by a small team of developers from Microsoft, which Guido recently joined.

When implementing the project, the developers intend to adhere to a number of restrictions, such as maintaining full compatibility at the ABI and code level, as well as the inadmissibility of performance gains due to slowdown in edge cases. Of the components that can be changed to improve performance, bytecode, data layout in memory, compiler and interpreter are noted.

The developments of the project are published in a separate faster-cpython repository. One of the project members, who previously developed the HotPy JIT compiler for CPython, has published a plan that makes it realistic to achieve five times the performance and achieve this result in the release of Python 3.13. The project is divided into four stages:

  • In Python 3.10, we plan to implement optimizations in the interpreter related to adapting the interpretation process to types and values ​​at run time.
  • The release of Python 3.11 is expected to bring improvements to the runtime and key objects, as well as the inclusion of many small specialized optimizations, such as speeding up binary operators and working with integer values ​​that fit in one machine word, speeding up calling and returning from functions, reducing runtime overhead memory and exception handling.
  • Python 3.12 will introduce a simple JIT compiler that can be used for a small amount of specialized code.
  • Python 3.13 will add new capabilities for generating native code at runtime and extend the use of the JIT compiler.

Source: opennet.ru

Add a comment