[off topic] Re: [Numpy-discussion] numarray speed - PySequence_GetItem

Todd Miller jmiller at stsci.edu
Tue Jun 29 15:03:02 CDT 2004

On Tue, 2004-06-29 at 16:19, Tim Hochberg wrote:
> I'd bet a case of beer (or cash equivalent) that one of the main 
> bottlenecks is the path 
> PySequence_GetItem->_ndarray_item->_universalIndexing->_simpleIndexing->_simpleIndexingCore.  

I won't take the bet but if this works out, you get the beer.  If it
doesn't, well, I don't drink anymore anyway.

> The path through _universalIndexing in particular, if I deciphered it 
> correctly,  looks very slow. I don't think it needs to be that way 
> though, _universalIndexing could probably be sped up, but more promising 
> I think _ndarray_item could be made to call _simpleIndexingCore without 
> all that much work. It appears that this would save the creation of 
> several intermediate objects and it also looks like a couple of calls 
> back to python! I'm not familiar with this code though, so I could 
> easily be missing something that makes calling _simpleIndexingCore 
> harder than it looks.

This looks very promising.  I'll take a look tomorrow.


More information about the Numpy-discussion mailing list