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

Andrew P. Lentvorski, Jr. bsder at mail.allcaps.org
Tue Jun 29 17:15:42 CDT 2004


On Jun 29, 2004, at 4:25 PM, Chris Barker wrote:

> Todd Miller wrote:
>> Yes.  What I most want to do is a 50000 point drawlines, similar to 
>> what
>> you profiled.  Friends are fine too.
>
> Actually, it was someone else that did the profiling, but here is a 
> sample, about as simple as I could make it.
>
> It draws an N point line and M points. At the moment, it is using 
> Numeric for the points, and numarray for the lines. Numeric is MUCH 
> faster (which is the whole point of this discussion). Otherwise, it 
> takes about the same amount of time to draw the lines as the points.
>
> Another note: if use the tolist() method in the numarray first, it's 
> much faster also:
>
> dc.DrawLines(LinesPoints.tolist())
>

If you are going to move lots of lines and points, I would recommend 
pushing this stuff through PyOpenGL with array objects and vertex 
objects.  Letting OpenGL handle the transformations, clipping, movement 
and iteration in hardware stomps all over even the best written C code. 
  Most UI toolkits have some form of OpenGL widget.

For lots of the code I have written, even Mesa (the open-souce software 
OpenGL renderer) was fast enough, and not having to write all of the 
display transformation code by hand was a huge win even when the speed 
was somewhat lagging.

-a





More information about the Numpy-discussion mailing list