[pypy-dev] Newcommer in pypy, numpy user
David Cournapeau
david at ar.media.kyoto-u.ac.jp
Mon Dec 18 04:32:45 CET 2006
Hi there,
I am a recently convert of python, which I started using for my
numerical computing needs (I am a PhD student in signal processing) to
replace matlab.
For those who do not know matlab, it is a big (and expensive)
software which implements a 'language' optimized for linear algebra, and
with time becomes one of the most used software for numerical
computation. In my field of research (signal processing), matlab is
almost a standard (by standard, I mean everybody knows it and uses it).
I think python with numpy/scipy is better in almost any way if you are
ready to invest some time.
Now, concerning pypy. The main idea of numpy is to give an array
class to python, so that most inner loops are not interpreted, but run
in Cpython or through highly optimized fortran libraries. In those
cases, python is fast enough for most cases. But there are some cases
where this paradigm of using linear algebra to speed things up does not
work really well (recursive algorithms); in those case, the loop +
function call cost of python makes any implementation for non toy
problems really slow. Right now, the only choice is to code the thing in
C, with a big loss on the flexibility side.
I was wondering if pypy has some solution/new approaches to this
problem. For example, when using numpy, I would suspect that many
functions calls are 'static', that is always expect the same type of
arguments; also, for simple loop on integers, my understanding is that
JIT compilation has some nice solution to give to have much better
performances (matlab has a JIT compiler to make loop faster for
interpreted code). It looks like at some point, there was some work done
in pypy relatively to numpy arrays, but I didn't find any documentation
on that.
cheers,
David
More information about the Pypy-dev
mailing list