[pypy-dev] array performace?
Maciej Fijalkowski
fijall at gmail.com
Thu Jul 1 16:46:09 CEST 2010
Hey.
There is a variety of reasons why those behave like this (array module
is in PyPy written in Python for example, using _rawffi). There is a
branch that plans to fix that for all lists, but that's not finished
yet.
On Thu, Jul 1, 2010 at 8:02 AM, Hakan Ardo <hakan at debian.org> wrote:
> Hi,
> are there any python construct that the jit will be able to compile
> into c-type array accesses? Consider the following test:
>
> l=0.0
> for i in xrange(640,640*480):
> l+=img[i]
> intimg[i]=intimg[i-640]+l
>
> With the 1.3 release of the jit it executes about 20 times slower than
> a similar construction in C if I create the arrays using:
>
> import _rawffi
> RAWARRAY = _rawffi.Array('d')
> img=RAWARRAY(640*480, autofree=True)
> intimg=RAWARRAY(640*480, autofree=True)
>
> Using a list is about 40 times slower and using array.array is about
> 400 times slower. Any suggestion on how to improve the performance of
> these kind of constructions?
>
> Thanx.
>
> --
> Håkan Ardö
> _______________________________________________
> pypy-dev at codespeak.net
> http://codespeak.net/mailman/listinfo/pypy-dev
>
>
>
>
More information about the Pypy-dev
mailing list