[Numpy-discussion] Fancy Indexing of Structured Arrays is Slow

Julian Taylor jtaylor.debian at googlemail.com
Fri May 16 13:01:38 EDT 2014


On 16.05.2014 10:59, Dave Hirschfeld wrote:
> Julian Taylor <jtaylor.debian <at> googlemail.com> writes:
> 
>>
>>
>> if ~50% faster is fast enough a simple improvement would be to replace
>> the use of PyArg_ParseTuple with manual tuple unpacking.
>> The PyArg functions are incredibly slow and is not required in
>> VOID_copyswap which just extracts 'Oi".
>>
>> This 50% increase still makes it slower than the simpler indexing
>> variant as these have been greatly improved in 1.9 (thanks to
>> Sebastian for this :) )
>>
> 
> Yes, I'd heard about the improvements and am very excited to try them out 
> since indexing is one of the bottlenecks in our algorithm. 
> 

I made a PR with the simple change:
https://github.com/numpy/numpy/pull/4721

improves it by the expected 50%, but its still 40% slower than the
improved normal indexing.



More information about the NumPy-Discussion mailing list