Let’s look at the performance of our Python programs and see how to make them up to 30% faster! Python haters always say, that one of the reasons they don’t want to use it, is that it’s slow . Well, whether specific program — regardless of the programming language used — is fast or slow is very much dependent on the developer who wrote it and their skill and ability to write optimized and fast programs. So, let’s prove some people wrong and let’s see how we can improve performance of our Python programs and make them really fast! Timing and Profiling Before we start optimizing anything, we first need to find out which parts of our code actually slow down the whole program. Sometimes the bottleneck of the program might be obvious, but in case you don’t know where it is, then here are options you have for finding out: Note: This is the program I will be using for demonstration purposes, it computes e to pow...
Comments
Post a Comment