Member-only story
Why Python is so slow and how to speed it up
Take a look under the hood to see where Python’s bottlenecks lie
In this article we’ll discover that Python is not a bad language that is just very slow. It is optimized for the purpose it is built: easy syntax, readable code and a lot of freedom for the developer. These design choices, however, do make Python code slower than other languages like C and Java.
Understanding how Python works under the hood will show us the causes of why it’s slower. Once the causes are clear we can work our way around it. After reading this article you’ll have a clear understanding on:
- how Python is designed and works under the hood
- why these design choices affect execution speed
- how we can work around some of these bottlenecks to increase the speed of our code significantly
This article is split in three parts. In part A we take a look at how Python is designed. Then, in part B see how and why these design choices affect speed. Finally, in part C we’ll learn how to work around the bottlenecks that result from Python’s design and how we can speed up our code significantly.
Let’s go!