The importance of design#

As your experience in data science grows I have no doubt that one lesson you will repeatedly learn is the importance of a good algorithm. A good algorithm can turn a seven day model run time into 4 hours (and a 14 day run time due to finding a mistake in the first run into an 8 hour run). A related lesson is that how you design your code to implement an algorithm also matters. Indeed the decisions you make in implementation can also have an order of magnitude impact on run time. In this section we will explore a simple problem - computing (small) prime numbers and how the choice of algorithm and its implementation can affect run time.