On Tue, Nov 10, 2009 at 11:15 PM, David Cournapeau < da...@ar.media.kyoto-u.ac.jp> wrote:
> Charles R Harris wrote: > > > > I think Python lists are basically just expanding arrays and pointers > > are cheap. Where you might lose is in creating python objects to put > > in the list and not having ufuncs and the rest of the numpy machinery. > > If you don't need the machinery, lists are probably not a bad way to go. > > I am not familiar enough with the kdtree code: if you need to manipulate > core datatypes (float, etc...), I think python lists are a significant > cost, because of pointer chasing in particular. It may or may not apply, > but Stefan used some tricks to avoid using python list and use basic C > structures in some custom code (written in cython), maybe he has > something to say. > > I would love having a core C library of containers - there are a few > candidates we could take code from: > I've got a cythonized structure for union-find (relations) and we could put together a heap pretty easily from heap sort. I've also got one for the problem at hand, but it is for several thousand points (stars) scattered over an image and uses c++ lists. Chuck
_______________________________________________ NumPy-Discussion mailing list NumPy-Discussion@scipy.org http://mail.scipy.org/mailman/listinfo/numpy-discussion