RE: speeding up Python script

2005-05-18 Thread Delaney, Timothy C (Timothy)
James Carroll wrote: > It looks like your algorithm really does iterate over all values for > six variables and do lots of math.. then you can't do any better than > implementing the inner loop in C. Or Pyrex ... http://www.cosc.canterbury.ac.nz/~greg/python/Pyrex/ For this type of situation, Py

Re: speeding up Python script

2005-05-18 Thread Luis P. Mendes
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 I appreciate everyone's help! I got some ideas that I'll try to put into practice. Regards, Luis -BEGIN PGP SIGNATURE- Version: GnuPG v1.2.4 (GNU/Linux) Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org iD8DBQFCi7QQHn4UHCY8

Re: speeding up Python script

2005-05-18 Thread James Carroll
It looks like your algorithm really does iterate over all values for six variables and do lots of math.. then you can't do any better than implementing the inner loop in C. It does look like you have some functions that are being called that are also in python, and it would be interesting to see i

Re: speeding up Python script

2005-05-18 Thread Grant Edwards
On 2005-05-18, Luis P. Mendes <[EMAIL PROTECTED]> wrote: > I have a 1000 line python script that takes many hours to > finish. It is running with six inside 'for' loops. [...] > How can I dramatically improve speed? In probably order of efficacy: 1) Use a better algorithm 2) Replace 'for'

Re: speeding up Python script

2005-05-18 Thread Lonnie Princehouse
Quick tip- Try xrange instead of range. This will use dramatically less memory if your search space is large, which will speed things up /if/ your machine is being forced to swap. Besides that, without seeing the code for your functions, it's hard to offer more advice. Your algorithm is necess

Re: speeding up Python script

2005-05-18 Thread Dan Sommers
On Wed, 18 May 2005 12:56:50 +0100, "Luis P. Mendes" <[EMAIL PROTECTED]> wrote: > The reason why I'm using six nested for loops is because I need to find > the best output using those six variables as input. > Here's the simplified code: > for per in range(): > ~for s in range(): > ~

Re: speeding up Python script

2005-05-18 Thread Robert Kern
Luis P. Mendes wrote: > -BEGIN PGP SIGNED MESSAGE- > Hash: SHA1 > > The reason why I'm using six nested for loops is because I need to find > the best output using those six variables as input. > > Here's the simplified code: > > for per in range(): > ~for s in range(): > ~fo

Re: speeding up Python script

2005-05-18 Thread Luis P. Mendes
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 The reason why I'm using six nested for loops is because I need to find the best output using those six variables as input. Here's the simplified code: for per in range(): ~for s in range(): ~for t in range(): for v in range()

Re: speeding up Python script

2005-05-18 Thread Tomasz Rola
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On Wed, 18 May 2005, Luis P. Mendes wrote: > 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 per

Re: speeding up Python script

2005-05-18 Thread Peter Dembinski
"Luis P. Mendes" <[EMAIL PROTECTED]> writes: > -BEGIN PGP SIGNED MESSAGE- > Hash: SHA1 > > 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

Re: speeding up Python script

2005-05-17 Thread James Stroud
You may want to read through this case study by the BDFL. http://www.python.org/doc/essays/list2str.html On Tuesday 17 May 2005 05:32 pm, Luis P. Mendes wrote: > Hi, > > I have a 1000 line python script that takes many hours to finish. It is > running with six inside 'for' loops. > > I've search

Re: speeding up Python script

2005-05-17 Thread Rune Strand
Without seeing any code, it's hard to tell, but it's not a wild guess that 'six inside for loops' may be replaced by more efficient ways ;-) -- http://mail.python.org/mailman/listinfo/python-list