[Tutor] Power Shells [WAS:] optimization: faster than for

Alan Gauld alan.gauld at btinternet.com
Mon Jul 2 01:13:10 CEST 2007


"elis aeris" <hunter92383 at gmail.com> wrote

> Use the best for-equivalent and run the code below,

Elis,

Can you tell us what exactly you are trying to do?

I'm not sure whether its just running tests on loop contructs
or trying to get a list of pixels from an image (and if so to do
what with them?)

Until we know what your underlying project is trying to achieve
its impossible to give sensible help in making things run faster.
As Kent mentioned the things you do with the pixels are likely
to make as much difference to total performance as the loops
you use. Python is not C and the fastest solution in one scenario
might not be fastest in another. It's better to get the best solution
that works then tune it for speed where its actually necessary.

What performance do you actually need?
What is too slow at the moment?

Are you in danger of succumbing to the danger of premature
optimisation? It looks a lot like it from your posts.

Alan G.




More information about the Tutor mailing list