Python 3.11 performance benchmarks are fantastic
Last month, Python 3.11 Beta 1 was released as the first preview of this major update to the Python programming language. Along with new language features and other improvements, Python 3.11 performance looks fantastic with a very nice performance improvement over previous versions of Python 3.x.
Python 3.11 supports task groups in asyncio, precise error locations in traces, autotype to return an instance of their class, TypeVarTuple for variadic generics, and various other features.
Along with changes to the Python language itself, Python 3.11 got performance work from the “Faster Cython Project” to speed up the reference implementation. Python 3.11 is 10-60% faster than Python 3.10 according to official figures and 1.22x speedup with their standard benchmark suite.
The Python docs cover some of the significant performance improvements in this upcoming release.
The official Python 3.11.0 release isn’t expected until October, while several beta releases will arrive through July, and then at least two candidate releases in the following months before early October.
Recently, on an AMD Ryzen 9 5950X dev box, I recently performed some benchmarks on the performance of Python 3.11 Beta 1 from last month (the latest development version at the time of testing). The performance of Python 3.11 Beta has been compared to previous versions, including Python 3.10.4, Python 3.9.13, and Python 3.8.13. All of these versions of Python were built from source in the same release configuration every time on this same system. A variety of different Python benchmarks were then performed to see how Python 3.11 looks compared to previous versions of Python.