NumPy vs. iterative vs. ???

Tim Lavoie tim.lavoie at mts.net
Wed Aug 30 17:41:05 EDT 2000


John J. Lee wrote:

>On Wed, 30 Aug 2000, Tim Lavoie wrote:
>[...]
>> I like the idea of NumPy, in that it does a lot for me and makes for more
>> elegant code. However, I'm not sure how well it fits this application, since
>> it prefers to apply each operation to every element in the array. Also,
>> keeping several arrays (some complex-type) for the whole works is very
>> RAM-hungry as well, at an element per pixel per array.
>[...]
>
>Is this really a problem when most (many, at least) machines have >=64 Mb
>RAM now?  It sounds like it's a simple memory / speed trade-off, and you
>should go for more speed.

Well, it does take a LOT of memory... Let's see. z and c are complex, so
they're each two double-precision floats per element, right? The other two
are integers, though one is just a flag holder, so could be smaller. That
would give something like 40 bytes per pixel, or roughly 2.5 MB in data for
a small, 250x250 image. Not bad... I just checked, and using the
NumTut.view() method to get output somehow blows the RAM requirements out of
the water, so I could use something else there too. It's still not blazing
speed either though, so I'm wondering if I should just come up with a C
module for the inner core, and use Python to wrap it in a GUI.


-- 
A debugged program is one for which you have not yet found the conditions
that make it fail.
                -- Jerry Ogdin



More information about the Python-list mailing list