"CRV§ADER//KY" <[email protected]> writes: > Just wondering, what's the performance for initialising a large > pyopencl.array in PyPy?
Well, to start with 'empty' won't do any initialization at all--that's
the point of it. :)
Next, the number of things PyPy has to do for a PyOpenCL array 'empty'
allocation is independent of the size, so I imagine that the only thing
that would influence allocation speed is the CL implementation you're
using.
> I'm asking because numpy.empty has abysmal performance on PyPy when you get
> to large dimensions:
>
> CPython:
>>>> timeit('np.empty((5,), dtype=np.float64)', setup='import numpy as np',
> number=1e6)
> 0.45080995559692383
>>>> timeit('np.empty((500000,), dtype=np.float64)', setup='import numpy as
> np', number=1e6)
> 0.5748040676116943
>
> PyPy:
>>>>> timeit('np.empty((5,), dtype=np.float64)', setup='import numpy as np',
> number=1e6)
> 0.20131182670593262
>>>>> timeit('np.empty((500000,), dtype=np.float64)', setup='import numpy as
> np', number=1e3)
> 1.2475969791412354
>
> PyPy is 2000 times slower than CPython when allocating 4MB worth of memory
> O_O
That's a bug I'd imagine. I'd suggest you report it--here's the URL:
https://bitbucket.org/pypy/numpy/issues
Andreas
pgpjZra3MhZ8a.pgp
Description: PGP signature
_______________________________________________ PyOpenCL mailing list [email protected] http://lists.tiker.net/listinfo/pyopencl
