[SciPy-user] Accelerating the calculation of a function

Gael Varoquaux gael.varoquaux at normalesup.org
Sun Aug 6 15:40:39 CDT 2006

    Hi list,

I am integrating an ODE. I thus have a complicated function that
I call a lot of times. What limits my execution times (currently too
high) is the call to this function, which happens a great number of
times. I therefore need to speed this up.

If  it  where a simple function I could use weave.inline or weave.blitz
but this is a rather complicated function involving a lot of python
magic that I would be very happy to keep ( things such as :
sum( [F(k) for k in lasers]) ).

How can I speed this up without rendering my function unreadable ? Is
there a compiler (Just in time, maybe) that could speed this up ? Is
psyco of any use ?

Is their a way to inline my functions (I would like to keep them as
functions for the sake of readability) ?

Any tricks or ideas appreciated.



More information about the SciPy-user mailing list