>> Also, if you are really interested in this then have a look at the C
>> source generated by Cython -- there's a lot of stuff going on in order
>> to acquire access to the ndarray, and if you find that disabling a line
>> which checks things spends a lot of time we could easily add a flag to
>> disable the check.
>>
>> Also I did once have plans for optimizing "np.empty" etc. so that no
>> Python overhead would be necesarry (through inlineable functions in
>> numpy.pxd), but I didn't have time for doing it.
>>
> I think I will try to do this, I don't really understand what it will
> entail,
> but heck, it would be sweet, basically having zeros and empty would make
> Cython super natural for what I often do.

Note that there is currently no such thing as inlineable functions in pxd
files! I would have to implement that in Cython first, which is no easy
task (at least if you haven't looked much at Cython code already).

But it would be very good to have, for starters, benchmarks for whether
calling the C function in arrayobject.h corresponding to np.empty provides
significant improvements. (Remember to call using the exact right integer
size for ndims!)

Dag Sverre

_______________________________________________
Cython-dev mailing list
[email protected]
http://codespeak.net/mailman/listinfo/cython-dev

Reply via email to