shunwang / numexpr

Automatically exported from code.google.com/p/numexpr
MIT License
0 stars 0 forks source link

Mechanism to store expressions in already existing ndarrays #56

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
This is a enhancement request.

It would be neat if numexpr could reuse an already allocated ndarray to store 
the result of the expression, in the same way as ufuncs do. This would be 
particularly useful for very large arrays.

If I am not mistaken, numexpr is always allocating new arrays for its output in 
memory. It results in a double penalty if the result has to be stored in an 
already existing array: 1) increasing the peak memory implies risks of swapping 
and 2) a copy is made (since out[:] does make a copy) .

Original issue reported on code.google.com by pierre.c...@gmail.com on 6 Sep 2011 at 9:11

GoogleCodeExporter commented 9 years ago
You are not mistaken, it does always allocate. The good news is that the 
feature is already implemented in the "newiter" branch will be the base for the 
next version of numexpr. I haven't tested the feature myself but I guess it 
works. It wouldn't hurt if you tested it :)

Original comment by gdemen...@gmail.com on 6 Sep 2011 at 10:25

GoogleCodeExporter commented 9 years ago
Just downloaded it and tested it... looks awesome!
Thanks!

Original comment by pierre.c...@gmail.com on 6 Sep 2011 at 9:50

GoogleCodeExporter commented 9 years ago
The branch which has this is merged into default, so marking as fixed.

Original comment by mwwi...@gmail.com on 30 Oct 2011 at 11:41