mailRe: Contact.


Others Months | Index by Date | Thread Index
>>   [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Header


Content

Posted by Edward d'Auvergne on May 04, 2006 - 06:04:
On 5/4/06, Andrew Perry <andrewjamesperry@xxxxxxxxxx> wrote:
Oh, the thing I forgot to tell you the other day .. I did some profiling
using psyco on relax. Pretty much putting import psyco; psyco.full() and
other things at the top of the program and getting some average execution
times for Monte carlo etc ... general result is that in some cases there
_may_ be a 10 % speedup, but it's generally doesn't seem to do much.

Not much of a surprise there.


The one useful thing is that psyco.profile() gives a nice profiling log which may be better that the python api 'profile' module. I suspect the psyco can't do much to optimise the Numeric C components, and things like 'sum' are taking a chunck of time.


Does psyco.profile() need to go in the same spot as the python profile() call? If you would like to add the code to the repository feel free. I'll vet any changes post-commit to make sure it fits into the style of the rest of the relax code. The development chapter of the manual gives a few details if you're interested. And lots of comments are good. Psyco could be imported with a try statement for portability and the psyco profile could sit next to the other profile (so you can choose between the two, if there are any benefits to that). It would be best to have some command line option like --profile or --psyco-profile (maybe with the aliases -p or -pp). I don't think that the base file 'relax' is setup to handle cmdline options and then run the profile. If you can't be bothered, don't worry about doing anything. Oh, the sum() call I would have expected to take a while because it is a loop. I don't know how efficient the Numeric sum() call is though. I would hope that it is a C rather than Python loop!

Edward



Related Messages


Powered by MHonArc, Updated Mon May 22 15:25:33 2006