Python 3.14 was released at the beginning of the month. This release was particularly interesting to me because of the improvements on the "free-threaded" variant of the interpreter. Specifically, the two major changes when compared to the free-threaded variant of Python 3.13 are: Free-threaded support now reached phase II, meaning it's no longer considered experimental The implementation is now completed, meaning that the workarounds introduced in Python 3.13 to make code sound without the GIL are now gone, and the free-threaded implementation now uses the adaptive interpreter as the GIL enabled variant. These facts, plus additional optimizations make the performance penalty now way better, moving from a 35% penalty to a 5-10% difference. Miguel Grinberg put together a nice article about Python 3.14 performance, with sections dedicated to the free-threaded variant compared to the GIL one. His results show a compelling improvement in performance for Python 3.14t compared to 3.13t, which is compelling! While his benchmarks focus on CPU-bound work, calculating the Fibonacci sequence and using the bubble sort algorithm, a huge part of my experience with Python is centered on web development – the main OSS projects I maintain are a web framework and a web server for Python, after all – and thus I wanted to make a proper comparison of free-threaded and GIL Python interpreters on web applications: even if 99.9999% of web services out there are I/O bound – interacting with a database or making requests to other services – concurrency is a key factor here, and we spent decades doing weird stuff with the multiprocessing module to do more work in parallel. Is this the time where we can finally stop wasting gigabytes of memory just to serve more than 1 request at time? Benchmarks are hard Let's face it. We had hard times understanding benchmarks – especially when those benchmarks are around web technologies. The internet is full of discussions around them, with people arguing ...
First seen: 2025-10-25 13:17
Last seen: 2025-10-26 05:56