All Pythons are slow, but some are faster than others
Python is not the fastest language around, so any performance boost helps, especially if you’re running at scale.
It turns out that depending where you install Python from, its performance can vary quite a bit: choosing the wrong version of Python can cut your speed by 10-20%.
Let’s look at some numbers.
Comparing builds Python
I ran three benchmarks from the pyperformance suite on four different builds of Python 3.9 (code is here):
python:3.9-buster
, the “official” Python Docker image.- Ubuntu 20.04, via the
ubuntu:20.04
Docker image. - Anaconda Python on
ubuntu:20.04
. - Conda-Forge on
ubuntu:20.04
.
If you’re not familiar with Conda, it’s a packaging system which includes precompiled libraries of pretty much all libraries and executables (including Python), other than the standard C