"Premature optimization is the root of all evil" | ||
--Donald Knuth, a renowned computer scientist and mathematician |
For real-world applications, performance is as important as features, robustness, maintainability, testability, and usability. Performance is directly proportional to the scalability of an application. Ending this book without looking at performance enhancement was never an option. In fact, we delayed discussing the topic of performance until the last chapter of the book to avoid premature optimization. In this chapter, we will give hints on improving performance using profiling as the key technique. We will also discuss the relevant frameworks for multicore, distributed systems. We will discuss the following topics in this chapter:
Profiling the code
Installing Cython
Calling the C code
Creating a pool process with multiprocessing
Speeding up embarrassingly parallel
for
loops with JoblibComparing Bottleneck to NumPy functions...