Speeding up Python

Ionel Simionescu ionel at psy.uva.nl
Wed Oct 20 13:57:24 EDT 1999


| > I read that Industrial Light And Magic is using Python, but I don't see
how
| > that is possible.

I find it quite possible.

| > I wonder if I'm missing something.  Any suggestions?

If you need to do math on large series of numbers, the Numeric module
(http://www.cwi.nl/www.python.org/download/Contributed.html#Math)
(ftp://ftp-icf.llnl.gov/pub/python/) will provide the performance you need.
I did not compare with C/C++ code but, in my case, NumPy code runs few times
faster than my correspondednt  MATLAB code.

As a matter of anecdote, my MATLAB code runs as fast as the C++
implementation of a colleague. Admittedly, he did not try hard enough, but
the point is that not the speed itself, as much the good trade-off between
the performance of (Python,Numeric) and the ease of programming. Ease of
programming, in turn, favors tweaking and helps identifying better
solutions. Faster.

If you are bound to the use of quite unusual data structures, which make
difficult vectorization, then you may need to use Python for prototyping
only. However, no widely used math package or language can help you better
in such a case.

ionel













More information about the Python-list mailing list