The first year of free-threaded Python

20 points by ngoldbaum


zipy124

On one hand I love performance increases, but on the other hand, if you want fast code it’s better to use Python as glue to call out to faster libraries via FFI which can already utilise the advantages of no GIL. When using Numpy or OpenCV functions for example most are not written in python and are already multi-threaded/process.

Since Python by most benchmarks is somewhere around 2 order of magnitudes slower than comparable compiled languages, even a 20x speed up on a 20 core machine is futile compared to re-writing it in a single-threaded compiled language. Not even considering that you can get that same speed up in your compiled language often with as little as one line of code using OpenMP in c++ or Julia for exaple.

In general if you want python and you want performance, It’s better to use Python for doing all the light work, and then calling to faster compiled code for anything performance critical. This allows you to get the best of both worlds in terms of speed and productivity and leveraging the ecosystem and batteries included std lib.