FW: [Numpy-discussion] Speeding up numarray -- questions on its design

Perry Greenfield perry at stsci.edu
Tue Jan 25 19:52:09 EST 2005


Hmmm, it looks like it was sent only to Chris. My mistake. -- Perry

-----Original Message-----
From: Perry Greenfield [mailto:perry at stsci.edu]
Sent: Tuesday, January 18, 2005 5:58 PM
To: Chris Barker
Cc: Perry Greenfield
Subject: Re: [Numpy-discussion] Speeding up numarray -- questions on its
design



On Jan 18, 2005, at 12:43 PM, Chris Barker wrote:

> Hi all,
>
> This discussion has brought up a question I have had for a while:
>
> Can anyone provide a one-paragraph description of what numarray does 
> that gives it better large-array performance than Numeric?

It has two aspects: one is speed, but for us it was more about memory. 
It is likely faster (for simpler cases, i.e., ones that don't involve 
strides, byteswaps or type conversions) because the C code for the loop 
is as simple as can be resulting in better optimizations. But we 
haven't done careful research on that. It has a number of aspects that 
lessen memory demands:

1) fewer temporaries created, particularly for type conversions.
2) avoids the memory wasting scalar type coercions that Numeric has.
3) allows use of memory mapping. This one is at the moment not a strong 
advantage due to the fact that the current limit is due to Python. 
Interesting large arrays sizes are bumping into the Python limit making 
this less useful. But when this goes away (this year I hope) it is 
again a useful tool for minimizing memory demands.

There are other advantages, but these are the primary ones that relate 
to large array performance that I recall offhand (Todd may recall 
others).

Perry







More information about the NumPy-Discussion mailing list