On 8/22/06, Carlos Pita <[EMAIL PROTECTED]> wrote:
I see.
I think the language libraries themselves must do some sort of pooling, at least the linux ones seem to. C++ programs do a lot of creation/destruction of structures on the heap and I have found the overhead noticeable but surprisingly small. Numpy arrays are a couple of layers of abstraction up, so maybe not quite as fast.
Chuck
One reason is to use operator syntax: buf1 = buf2 + buf3, instead of add(buf2,buf3, buf1). The other is to spare the final user (synth programmer) any buffer bookkeeping.
I see.
My idea was to keep track of pooled buffers' reference counts, so that those currently unused would have a refcount of 1 and could be safely deleted (well, if pool policy variables allow it). But as buffers are acquired all the time, even a simple (pure-python) pooling policy implementation is pretty time consuming. In fact, I have benchmarked this against simply creating new zeros-arrays every time, and the non-pooling version just runs faster. That was when I thought that numpy could be doing some internal pooling by itself.
I think the language libraries themselves must do some sort of pooling, at least the linux ones seem to. C++ programs do a lot of creation/destruction of structures on the heap and I have found the overhead noticeable but surprisingly small. Numpy arrays are a couple of layers of abstraction up, so maybe not quite as fast.
Chuck
------------------------------------------------------------------------- Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________ Numpy-discussion mailing list Numpy-discussion@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/numpy-discussion