help!: optimization of search problem (example code)

Jason Orendorff jason at jorendorff.com
Thu Feb 14 16:21:05 EST 2002


Marcus Stojek wrote:
> This takes 5.3 sec on my machine for 500 points. That is much too
> long. Any idea how I could significanty improve this code?

On my machine I was able to reduce the time between startclock()
and stopwatch() by 25% just by wrapping all that stuff in a big
function.

In Python, access to local variables in functions
is faster than access to global variables.

More to come.

## Jason Orendorff    http://www.jorendorff.com/




More information about the Python-list mailing list