[pypy-dev] bounties for pypy

Maciej Fijalkowski fijall at gmail.com
Sun Jul 3 20:54:59 CEST 2011


On Sun, Jul 3, 2011 at 8:35 PM, Ian Ozsvald <ian at ianozsvald.com> wrote:
> Hi Maciej. I said that based on what was discussed in Armin+Antonio's
> talk at EuroPython. If it takes 6+months for a numpy re-implementation
> then I'm suggesting that we're into 2012. I'd be *very* happy to be
> proved wrong!

I would estimate numpy for less than 6 months (numpy, not scipy and
not matplotlib), but well that's me. There is also a lot of outside
contribution, so it might take less wall time than manmonth time. From
my perspective, if we can secure *some* funding for numpy, it should
be ready sooner than 6 months from now.

>
> Do Python 'array' objects run faster than lists in PyPy? I believe
> that in CPython they run at the same speed (i.e. they're just a
> convenient storage system, they don't offer any of numpy's efficient
> math benefits).

The situation between PyPy and CPython is quite different here. As of
now, both PyPy and CPython store wrapped objects in lists (let's call
them PyIntObject) and unwrapped (C level int) in numpy arrays. In case
you have only interpreter, when reading a list you do:

py_x = list[index]
do_something_with_py_x

when reading from numpy array (or array.array), you do:

py_x = new PyIntObject(array[index])
do_something_with_py_x

so you use less memory (cache is better), but you allocate a new
object each iteration (bad)

But in case of the JIT, what happens is (list case)

py_x = list[index]
x = py_x.value
do_something_with_x # x as in integer value not py_x

array:

x = list[index]
do_something_with_x

Hence, no allocation and memory saving - huge win!

>
> Does the micronumpy library support doubles yet? If so I'd be happy to
> give it a go. If 'micronumpy' is the wrong name then tell me where I
> should look, I'm just going on what I've remembered from the PyPy-blog
> discussions about numpy support.

yes, doubles is pretty much all it supports as of now :) micronumpy is
a good name, but it comes under a name "numpy", so you can do "import
numpy". Not much will work though :-)

Note that we're also in the process of implementing faster vectorized
operations, like numpyexpr, except better. The list of operations is
very limited as of now though.

Cheers,
fijal

PS. If it's unclear, I can try to explain more or pop up on IRC.


More information about the pypy-dev mailing list