Python isn't necessarily slow

Fernando Pérez fperez528 at yahoo.com
Mon Mar 4 08:59:25 EST 2002


Siegfried Gonzi wrote:

> 
> I wrote this all, because I have sometimes seen people in comp.lang.lisp
> which are saying that they come
> from Python and want to use Lisp because Python is very slow. Surely, a
> matrix-matrix multiplication of
> the dimension 1024x1024 in Common Lisp (only a simple code without any
> declarations) is about 5 to 10
> times faster than a native Python code with native Python arrays (a
> Clean version is even about 100
> times faster). This is a  fact. But there is NumPy out there and most of
> the time a scientific data
> evaluation does not include array handling ala matrix-matrix
> multiplication. Often you steer through
> your data sequentially.

If you are really intersted in python for scientific computing, you need to 
look at scipy.org. There you'll find atlas-based matrix handling routines 
which will probably easily beat any lisp code you can come up with (atlas is 
optimized in assembly for your processor). But the high-level interface is 
still python, so you don't need to drop down to the assembly code ever.

Cheers,

f



More information about the Python-list mailing list