Assistance sought with mondo numerical app
Fernando Pérez
fperez528 at yahoo.com
Tue Apr 16 13:56:15 EDT 2002
Chris Barker wrote:
> "D. Michael McFarland" wrote:
>> The bottlenecks now seem to be in
>> memory management, which I'm sure Python does better than I would in
>> C,
>
> better than me too, I'm sure, but NumPy code often ends up making a lot
> more copies of data that similar C code would, so that might very well
> get better in C too.
>
This is another one for which weave can be a godsend. The blitz module in
weave can for many numeric expressions generate equivalent C++ code which
avoids all the intermediate copies. I don't want to sound like a cheerleader
(I'm not a developer of weave, only a user), but weave is really amazing in
how easily it allows you to integrate Numeric pyhton code with C snippets.
If anyone needs, I have a bunch of little examples lying around which I wrote
when I was learning weave and which I can pass along, just drop me a line.
Cheers,
f.
More information about the Python-list
mailing list