[Numpy-discussion] Multiple Boolean Operations

Robert Kern robert.kern at gmail.com
Thu May 22 14:46:13 EDT 2008


On Thu, May 22, 2008 at 12:26 PM, Stéfan van der Walt <stefan at sun.ac.za> wrote:
> Just to clarify things in my mind: is VTK *that* slow?  I find that
> surprising, since it is written in C or C++.

Performance can depend more on the design of the code than the
implementation language. There are several places in VTK which are
slower than they strictly could be because VTK exposes data primarily
through abstract interfaces and only sometimes expose underlying data
structure for faster processing. Quite sensibly, they implement the
general form first.

It's much the same with parts of numpy. The iterator abstraction lets
you work on arbitrarily strided arrays, but for contiguous arrays,
just using the pointer lets you, and the compiler, optimize your code
more.

-- 
Robert Kern

"I have come to believe that the whole world is an enigma, a harmless
enigma that is made terrible by our own mad attempt to interpret it as
though it had an underlying truth."
 -- Umberto Eco


More information about the NumPy-Discussion mailing list