I’m starting a series on Python performance optimizations, Looking for real-world use cases!
News faster CPython, JIT and 3.14
Why Python is slow and how to make it faster
How does Python 3.13 perform vs 3.11 in single-threaded mode?
Videos
Hey everyone,
I’m planning to start a series (not sure yet if it’ll be a blog, video, podcast, or something else) focused on Python performance. The idea is to explore concrete ways to:
-
Make Python code run faster
-
Optimize memory usage
-
Reduce infrastructure costs (e.g., cloud bills)
I’d love to base this on real-world use cases instead of just micro-benchmarks or contrived examples.
If you’ve ever run into performance issues in Python whether it’s slow scripts, web backends costing too much to run, or anything else I’d really appreciate if you could share your story.
These will serve as case studies for me to propose optimizations, compare approaches, and hopefully make the series valuable for the community.
Thanks in advance for any examples you can provide!
As there was a recent discussion on Python's speed, here is a collection of some good articles discussing about Python's speed and why it poses extra challenges to be fast as CPU instructions/executed code.
-
Pycon talk: Anthony Shaw - Why Python is slow
-
Pycon talk: Mark Shannon - How we are making CPython faster
-
Python 3.13 will ship with --enable-jit, --disable-gil
-
Python performance: it’s not just the interpreter
-
Cinder: Instagram's performance-oriented Python fork
Also remember, the raw CPU speed rarely matters, as many workloads are IO-bound, network-bound, or a performance question is irrelevant... or: Python trades some software development cost for increased hardware cost. In these cases, Python extensions and specialised libraries can do the heavy lifting outside the interpreter (PyArrow, Polards, Pandas, Numba, etc.).
When Python 3.12 was released, I had held back from migrating my Python 3.11 applications as there were some mixed opinions back then about Python 3.12's performance vs 3.11. Then, 3.13 was released, and I decided to give it some time to mature before evaluating it.
Now, we're in Python 3.13.3 and the last bugfix release of 3.11 is out. When I Google'd, I only found performance studies on Python 3.13 in its experimental free-threaded mode, which is definitely slower than 3.11. However, I found nothing about 3.13 in regular GIL mode.
What are you guys' thoughts on this? Performance-wise, how is Python 3.13 compared to Python 3.11 when both are in GIL-enabled, single-threaded mode? Does the experimental JIT compiler in 3.13 help in this regard?