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

2016-09-01 Thread Tom Cornebize
Tom Cornebize added the comment: Thank you for these explanations. I understand that we get a generic function to the cost of performances. However, I think we should at least tell in the documentation that the constructor (ctypes.c_uint32 * len(t))(*t) is slow and that we can do much faster

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

2016-09-01 Thread Tom Cornebize
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://stackov