numarray speed question

grv grv575 at
Wed Aug 4 02:42:38 CEST 2004

So it is supposed to be very fast to have an array of say 5 million 
integers stored in a binary file and do

a = numarray.fromfile('filename', (2, 2, 2))
numarray.add(a, 9, a)

but how is that faster than reading the entire file into memory and then 
having a for loop in C:
   (loop over range) {
      *p++ += 9      }

or is that essentially what's going on?

More information about the Python-list mailing list