Article complete

Python Releases Python 3.11 With Big Performance Improvements

The 3.11 series is the newest major release of the programming language, containing new features and optimizations

Colorful Python logos surrounded by cardboard textures, highlighting the release of Python 3.11 and its performance improveme

Key takeaways

  • Python 3.11 introduces significant performance improvements, making it substantially faster than its predecessor, Python 3.10.
  • The release includes new features such as async I/O task groups and enhanced error reporting in tracebacks.
  • A notable addition is the 'specializing adaptive interpreter', which optimises code execution by using type-specific bytecodes.
  • Python 3.11's enhancements allow existing programs to run faster without requiring code modifications from users.

Takeaways drafted with AI from the article text.

High-level programming language Python has announced the stable release of Python 3.11.0 in a blog post on Monday. The 3.11 series is the newest major release of the programming language containing new features and optimizations.

Some of the main features include adding support for task groups with async I/O, fine-grained error locations in tracebacks, exception groups and except*, support for parsing TOML in the standard library, and various typing changes. 

The biggest addition among the many individual performance improvements in Python 3.11 is the ‘specializing adaptive interpreter’. The interpreter attempts to analyze running code and replace general bytecodes with type-specific ones, as an object's type rarely changes. For example, binary operations such as addition and subtraction can be replaced with specialized versions for floats, integers,and strings.

As per the official Python benchmark suite, the 3.11 version runs 1.25 times faster than Python 3.10 (as an aggregate measure). Users don't need to make any code changes for Python programs to benefit from the Python 3.11's speedups.
To know more about the downloads and information on Python 3.11, click here.

Published

Spotted an error? Tell our editors. Read our editorial standards and corrections.