speeding up Python script

Delaney, Timothy C (Timothy) tdelaney at avaya.com
Wed May 18 19:08:17 EDT 2005


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, Pyrex is pretty much perfect. You can write
your algorithm in Python, get it right, then optimise it with static
typing, C variables, etc as required. You don't even need to change your
test suite because you build a Python extension module.

Tim Delaney



More information about the Python-list mailing list