State of Python 3.13 Performance: Free-Threading
Python 3.13 introduces free-threading without the GIL, enhancing performance for parallel applications. However, current slowdowns due to interpreter limitations are expected to improve in future releases.
Read original articlePython 3.13 has introduced significant performance enhancements, particularly with the experimental free-threaded mode that allows CPython to operate without the Global Interpreter Lock (GIL). This change aims to improve the utilization of multi-core processors, which has been a limitation in previous versions. The release also features a new just-in-time (JIT) compiler and the inclusion of the mimalloc memory allocator. The article discusses the implications of free-threading, particularly in the context of the PageRank algorithm, which is computationally intensive and benefits from parallelization. Traditional multiprocessing methods have drawbacks, such as high memory overhead and communication costs, which can hinder performance. The article compares single-threaded, multithreaded, and multiprocessing implementations of PageRank, highlighting that while the multithreaded approach in Python 3.13 without the GIL shows promise, the free-threaded build currently introduces performance slowdowns due to the disabling of the specializing adaptive interpreter. Future releases, particularly Python 3.14, are expected to address these issues, making free-threading a more viable option for parallel applications. Overall, while the free-threaded mode presents a promising advancement, it remains experimental and is not yet suitable for production use.
- Python 3.13 introduces free-threading, allowing execution without the GIL.
- The new JIT compiler and mimalloc allocator are also part of this release.
- Free-threading can significantly enhance performance for parallel applications.
- Current performance measurements show slowdowns with free-threading due to interpreter limitations.
- Future Python releases are expected to improve the viability of free-threading for production use.
Related
Free-threaded CPython is ready to experiment with
CPython 3.13 introduces free-threading to enhance performance by allowing parallel threads without the GIL. Challenges like thread-safety and ABI compatibility are being addressed for future adoption as the default build.
GIL Become Optional in Python 3.13
Python 3.13 introduces an experimental feature to disable the Global Interpreter Lock (GIL), enhancing concurrency in multi-threaded applications, while allowing users to manage GIL status through various options.
500 Python Interpreters
Python 3.13 will introduce an optional Global Interpreter Lock (GIL) to enhance multithreading performance, addressing historical limitations that affected applications like video games and presenting challenges for extension developers.
Everything you need to know about Python 3.13 – JIT and GIL went up the hill
Python 3.13, releasing on October 2, 2024, introduces a free-threaded version allowing GIL disabling, enhancing multi-threading performance while potentially reducing single-threaded task performance by 20%.
Python 3.13.0 Is Released
Python 3.13, released on October 7, 2024, features a revamped interpreter, experimental free-threaded execution, a JIT compiler, removal of deprecated modules, and enhanced typing capabilities for improved performance and usability.
Python is never really going to be 'fast' no matter what is done to it because its semantics make most important optimizations impossible, so high performance "python" is actually going to always rely on restricted subsets of the language that don't actually match language's "real" semantics.
On the other hand, a lot of these changes to try and speed up the base language are going to be highly disruptive. E.g. disabling the GIL will break tonnes of code, lots of compilation projects involve changes to the ABI, etc.
I guess getting loops in Python to run 5-10x faster will still save some people time, but it's also never going to be a replacement for the zoo of specialized python-like compilers because it'll never get to actual high performance territory, and it's not clear that it's worth all the ecosystem churn it might cause.
Learning it has only continued to be a huge benefit to my career, as it's used everywhere which underlies how important popularity of a language can be for developers when evaluating languages for career choices
3.13t doesn't seem to have been meant for any serious use. Bugs in gc and so on are reported, and not all fixes will be backported apparently. And 3.14t still has unavoidable crashes. Just too early.
Related
Free-threaded CPython is ready to experiment with
CPython 3.13 introduces free-threading to enhance performance by allowing parallel threads without the GIL. Challenges like thread-safety and ABI compatibility are being addressed for future adoption as the default build.
GIL Become Optional in Python 3.13
Python 3.13 introduces an experimental feature to disable the Global Interpreter Lock (GIL), enhancing concurrency in multi-threaded applications, while allowing users to manage GIL status through various options.
500 Python Interpreters
Python 3.13 will introduce an optional Global Interpreter Lock (GIL) to enhance multithreading performance, addressing historical limitations that affected applications like video games and presenting challenges for extension developers.
Everything you need to know about Python 3.13 – JIT and GIL went up the hill
Python 3.13, releasing on October 2, 2024, introduces a free-threaded version allowing GIL disabling, enhancing multi-threading performance while potentially reducing single-threaded task performance by 20%.
Python 3.13.0 Is Released
Python 3.13, released on October 7, 2024, features a revamped interpreter, experimental free-threaded execution, a JIT compiler, removal of deprecated modules, and enhanced typing capabilities for improved performance and usability.