Chapter 13. Optimization: Solutions
Optimizing a program is not a magical process. It is done by following a simple process, synthesized by Stefan Schwarzer at Europython 2006 in an original pseudo-code example:
def optimize(): """Recommended optimization""" assert got_architecture_right(), "fix architecture" assert made_code_work(bugs=None), "fix bugs" while code_is_too_slow(): wbn = find_worst_bottleneck(just_guess=False, profile=True) is_faster = try_to_optimize(wbn, run_unit_tests=True, new_bugs=None) if not is_faster: undo_last_code_change() # By Stefan Schwartzer, Europython 2006
This chapter presents some solutions to optimize your program through:
Reducing the complexity
Reducing the Complexity
There are ...