PyPy numpy developer here. I don't mean to highjack the list, so just a short comment to say that np.empty on PyPy actually zeros out the memory, it's a known performance issue. We are currently trying to obtain feature-equivalence before diving into performance issues, but we would appreciate users feedback for issues that block their use of PyPy. If this is a game-breaker for you please report it as an issue.
Matti

On 9/06/2014 7:00 PM, [email protected] wrote:

Date: Sun, 8 Jun 2014 23:35:57 +0100
From: CRV§ADER//KY <[email protected]>
To: Andreas Klöckner <[email protected]>
Cc: Pyopencl <[email protected]>
Subject: Re: [PyOpenCL] PyOpenCL, PyPy, and future directions
Message-ID:
        <caprcxo3rasgwy0f7cbewxlqunj2q8mbbj13cihvjtuyh9fx...@mail.gmail.com>
Content-Type: text/plain; charset="utf-8"

Just wondering, what's the performance for initialising a large
pyopencl.array in PyPy?
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



_______________________________________________
PyOpenCL mailing list
[email protected]
http://lists.tiker.net/listinfo/pyopencl

Reply via email to