Python is a commonly used programming language, but one of its weakness is performance. It’s quite known that Python is not the fastest programming language ever, but sometimes (and according to the use case) all its advantages are a valid reason for using it anyway.
But why is Python so slow? There are multiple benchmarks, and often even compared to other interpreted languages, Python is still slower. I haven’t seen any article as detailed as this one on the reason why Python is so slow. In this article the author is researching three options as the answer:
- It’s the GIL (Global Interpreter Lock)
- It’s because its interpreted and not compiled
- It’s because its a dynamically typed language
These are the most common theories on why Python is slow, but after studying the code and benchmarks (everything is detailed in the article), only one of the three is the real answer and the biggest reason why Python is so slow. Which one do you think?
I’m not going to give you the answer here, you can read the full article to find it out, and I suggest you do so, it’s a very interesting and detailed reading on interesting performance topics. If you are not interested in the full article you can skip to the conclusion to have your answer.