Why Python is so slow and how to speed it up
Mitigate speed bottle necks by taking a look under the hood
Python is a tool that’s so easy to use, that it is very easy to use it in the wrong way, leading to all kinds of performance issues. Today we’ll discover that Python is not a bad language that is very slow but often used in the wrong way. It is optimized for the purpose it is built: easy syntax, readable code and a lot of freedom for the developer. These design choices cause Python code to execute a little slower than other languages like C and Java but still pretty performant when used in the right way.
In order to use Python in the right way we’ll take a look under the hood and see how Python works. This allows us to understand the causes of slow Python code and work our way around it. In other words:
Understand your tool, hold it correctly, apply it efficiently
After reading this article you’ll have a clear understanding of how Python is designed, why these design choices affect execution speed and how we can work around the bottlenecks to increase the speed of our code significantly
This article is split in three parts.
Part A: how is Python designed?
Part B: how and why do these design choices affect speed?
Part C: how to work around the bottlenecks and speed up code significantly.
Let’s go!
Keep reading with a 7-day free trial
Subscribe to Python and Friends to keep reading this post and get 7 days of free access to the full post archives.