Make Python Up to 150× Faster with C
towardsdatascience.com·2h
Flag this post

, sooner or later, you’re going to hit a block when it comes to your code execution speed. If you’ve ever written a computationally heavy algorithm in Python, such as string distance, matrix math, or cryptographic hashing, you’ll know what I mean.

Sure, there are times when external libraries like NumPy can come to your rescue, but what happens when the algorithm is inherently sequential? That was precisely my problem when I wanted to benchmark a particular algorithm, which determines the number of edits required to transform one string into another.

I tried Python. I tried NumPy. And then I turned to C, a language I first learned at college decades ago but hadn’t used in anger for about 15 years. That’s where things got interesting.

I first had to answer the question, “Can you…

Similar Posts

Loading similar posts...