[Numpy-discussion] Array pooling

Charles R Harris charlesr.harris at gmail.com
Tue Aug 22 22:31:32 CDT 2006


On 8/22/06, Carlos Pita <carlosjosepita at yahoo.com.ar> wrote:
>
> Hi! I'm writting a real time sound synthesis framework where processing
> units are interconnected via numpy arrays. These buffers are all the same
> size and type, so it would be easy and convenient pooling them in order to
> avoid excesive creation/destruction of arrays (consider that thousands of
> them are acquired and released per second, but just a few dozens used at the
> same time). But first I would like to know if numpy implements some pooling
> mechanism by itself. Could you give me some insight on this? Also, is it
> possible to obtain an uninitialized array? I mean, sometimes I don't feel
> like wasting valuable cpu clocks filling arrays with zeros, ones or
> whatever.
>

Is there any reason to keep allocating arrays if you are just using them as
data buffers? It seems you should be able to reuse them. If you wanted to be
fancy you could keep them in a list, which would retain a reference and keep
them from being garbage collected.

Chuck
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://projects.scipy.org/pipermail/numpy-discussion/attachments/20060822/0b7f5e7b/attachment.html 


More information about the Numpy-discussion mailing list