Some great tips for optimising Python, courtesy of Ian Bicking:
- Kata 19: an optimization anecdote demonstrates some neat techniques including use of the gc module to fine tune garbage collection.
- Python Patterns—An Optimization Anecdote mainly uses functional programming techniques and the array module.
- An Optimization Anecdote from Fredrik Lundh teaches us that the more time is spent by Python in pure C routines, the faster code will run (note that this does not necessarily imply rewriting Python code in C).
- Python Performance Tips from 1996, most of which look like they are still valid.
- Python optimization tips, which seem to be a bit more up to date.