[issue27926] ctypes is too slow to convert a Python list to a C array

Tom Cornebize report at bugs.python.org
Thu Sep 1 05:31:15 EDT 2016


New submission from Tom Cornebize:

It is much faster to construct a Python array from the list and then cast this array, rather than using the "standard" constructor. See attached file to compare the performances.

This issue was previously asked on Stackoverflow: http://stackoverflow.com/questions/39225263/why-is-ctypes-so-slow-to-convert-a-python-list-to-a-c-array/

----------
components: ctypes
files: ctypes_slow.py
messages: 274111
nosy: Tom Cornebize
priority: normal
severity: normal
status: open
title: ctypes is too slow to convert a Python list to a C array
type: performance
Added file: http://bugs.python.org/file44320/ctypes_slow.py

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue27926>
_______________________________________


More information about the Python-bugs-list mailing list