[PyPy-issue] [issue593] ctypes.Array performance issues

David Naylor pypy-dev-issue at codespeak.net
Fri Dec 3 12:49:10 CET 2010


New submission from David Naylor <naylor.b.david at gmail.com>:

ctypes.Array performance in PyPy is substantially slower than CPython.  A 
profile shows that PyPy's Array assigns each item of the array, which is rather 
slow.  

The following (reduced) code shows the problem:

# cat ctype-array.py
from multiprocessing import Array
from time import time

data = " " * (1024 * 1024 * 10)  # 10MiB
start = time()
array = Array('c', data, lock=False)
print "%fs" % (time() - start)

# python ctypes-array.py 
4.234547s
# pypy-fast-forward ctypes-array.py
32.414674s

which shows an approximate 7.5x increase in execution time, against PyPy.

----------
effort: ???
messages: 1933
nosy: DragonSA, pypy-issue
priority: bug
release: ???
status: unread
title: ctypes.Array performance issues

_______________________________________________________
PyPy development tracker <pypy-dev-issue at codespeak.net>
<https://codespeak.net/issue/pypy-dev/issue593>
_______________________________________________________



More information about the Pypy-issue mailing list