I want to do exactly what this guy did:
Python - count sign changes
However I need to optimize it to run super fast. In brief I want to take a time series an
Do you want to time it? Or do you want to make it as fast as possible?
Timing is easy. Run it a zillion times, stopwatch it, and divide by a zillion.
To make it as fast as possible, what you need to do is find out what's taking time and that you could do in a better way. I use either 1) the random-pause technique, or 2) the single-step technique.