bitshuffle icon indicating copy to clipboard operation
bitshuffle copied to clipboard

Expose the `out` parameter to avoid malloc of output array

Open kif opened this issue 2 years ago • 0 comments

This patch offers the user the ability to provide an output buffer for all functions exposed at the Python level. This feature avoids the array creation and permits to recycle explicitly temporary buffers.

Despite the Python memory allocator is supposed to recycle memory in the back of the programmer, it fails sometimes, for example in timeit mode where the garbage collector is disabled. Under such situation the code can becomes terribly slow and causes huge memory leaks.

kif avatar Oct 13 '23 07:10 kif