speeding up Python

L

Luis P. Mendes

Hi,

I have a 1000 line python script that takes many hours to finish. It is
running with six inside 'for' loops.

I've searched the net for ways to speed up the proccess.

Psyco improves performance around 3% in this case which is not good enough.

How can I dramatically improve speed?

I tried to find some tool that converts Python to C automatically but
couldn't. As I don't know C, I think that weave and PyInline for
example are out of the solution.

I'm using Linux.

Luis
 
D

Dave Brueck

Luis said:
I have a 1000 line python script that takes many hours to finish. It is
running with six inside 'for' loops.

Hi Luis,

Before going too much into optimizing your current code, you might want to take
a step back and see if another approach to your problem might work instead.
Python is great for this sort of algorithmic experimentation.

So: what are you doing? In particular, why SIX nested loops?

It's not uncommon for a different algorithm to yield performance improvements
that are orders of magnitude greater than what just optimizing the code could
achieve.

-Dave
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,995
Messages
2,570,230
Members
46,819
Latest member
masterdaster

Latest Threads

Top