November 2010
Intermediate to advanced
332 pages
11h 57m
English
Make it work, make it right, make it fast. | ||
| --Kent Beck | ||
This appendix is a tiny peek at some of the options for tweaking the constant factors of your implementations. Although this kind of optimization in many cases won't take the place of proper algorithm design—especially if your problems can grow large—making your program run ten times as fast can indeed be very useful.
Before calling for external help, you should make sure you're using Python's built-in tools to their full potential. I've given you some pointers throughout the book, including the proper uses of list versus deque, and how bisect and heapq can give you a great performance boost under the right circumstances. As a Python programmer, ...