In this chapter, we will cover the following recipes:
Understanding the optimization process
Identifying common performance bottlenecks in code
Reading through the code
Profiling Python code with the Unix time function
Profiling Python code using built-in Python functions
Profiling Python code using IPython's %timeit function
Profiling Python code using line_profiler
Plucking the low-hanging (optimization) fruit
Testing the performance benefits of NumPy
Rewriting simple functions with NumPy
Optimizing the innermost loop with NumPy