numpy/numpy — pull request #4322 by juliantaylor (2014-02-18 18:43:21+00:00)
Title: ENH: perform inplace operations if one operand is a temporary

temporaries are identified by having a reference count of 1, if this is
the case we can perform inplace operations to avoid creating another
temporary.
E.g.

a = b + c + d

contains one temporary (c + d) with reference count 1 while the other
operands have count 2, so b + temp can be performed inplace.
This saves memory allocation overheads and improves cache utilization.