[Numpy-discussion] Alternate C-only array protocol for speed?

Travis Oliphant oliphant at ee.byu.edu
Fri Apr 8 13:55:27 EDT 2005


David M. Cooke wrote:

>It seems that people are worried about speed of the attribute-based
>array interface when using small arrays in C.
>  
>
I think we are talking about here an *array protocol*   (i.e. like the 
buffer protocol and sequence
protocol). 

So far we have just described the Python level interface.  I would like 
to see an array protocol added (perhaps to the buffer protocol table).  
This could be done just as David describes --- we don't even need to use 
the C-pointer (just return a void *pointer which has a version as the 
first entry).

I think this is how the C-level should be handled, I think.  Yes, it 
does not require changes to Python to implement the __array_c__  
attribute.  But, ultimately, it would be better if we used the C-level 
protocol concept that Python already uses for other objects.

-Travis





More information about the NumPy-Discussion mailing list