Python 3.12 was released with improvements to speed and efficiency, as key developers reported at this year's PyCon conference in Salt Lake City, Utah.
They also mentioned their efforts to reduce memory usage, faster interpreter and optimize compilation for more efficient code.
With the subinterpreters the time implementationA Python script can have multiple interpreters running together within a single process, as opposed to each interpreter running in isolation in its own process. Although subinterpreters were available in the Python runtime, they lacked an end-user interface. Also, the clutter of Python's internals has not allowed for efficient use of subinterpreters.
With Python 3.12, Python core developer Eric Snow and his team cleaned up Python enough to make subinterpreters useful for everyone.
Python 3.11 brought new bytecode to the interpreter, called adaptive commands (adaptive instructions). These commands could be automatically replaced at runtime with versions specialized for a given Python type, a process called quickening.
This saved the interpreter the step of looking up object types, greatly speeding up the whole process. Python 3.12 has even more custom commands…
More technical details
https://docs.python.org/3.12/whatsnew/3.12.html