Do you love TurnKey? Have a few spare cycles and want to help out?

2022-05-17 Update: Please note that due to a bug, all v17.0 appliances have now been bugfixed and rebuilt as v17.1. The v17.x release will continue, with all new appliances to be released as v17.1.

Python optimization principles and methodology

Methodology

The basic methodology for optimization:

  1. Discover where you program is spending its time (hotspots vs coolspots)

    A good way to get an overview is to use the Python profiler. The Python profile will usually be included in Python's standard library:

4 simple software optimization tips

1) Always be experimenting!

Trying to squeeze out more performance out of your program? Don't be afraid to experiment!

In practice what that means is you setup small, simple throwaway experiments to establish how things work when you're not absolutely sure you fully understand something such (e.g., how many times a second a certain function can be invoked, how the profiler measures blocking IO or the time it takes a sub-program to complete).