[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 

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 
# pypy-fast-forward ctypes-array.py

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>

More information about the Pypy-issue mailing list