diff NEWS @ 9609:599e92aaa4c0

update NEWS
author Jaroslav Hajek <highegg@gmail.com>
date Thu, 03 Sep 2009 16:19:08 +0200
parents dbd0c0f82480
children 2c5169034035
line wrap: on
line diff
--- a/NEWS
+++ b/NEWS
@@ -81,6 +81,37 @@
  ** Octave now allows user-defined subsasgn methods to optimize out redundant copies.
     For more information, see the manual.
 
+ ** When evaluating nested expressions, Octave will now make some attempts to
+    reuse temporary arrays instead of allocating new one for each result.
+    For instance, the expression
+    
+      -(2*a + b)
+
+    where a and b are arrays, will now be done like this:
+
+      allocate c
+      for all i: c(i) = 2*a(i)
+      for all i: c(i) = c(i) + b(i)
+      for all i: c(i) = -c(i)
+      c is the result
+
+    previously, a new temporary was allocated for each intermediary result
+
+      allocate c
+      for all i: c(i) = 2*a(i)
+      allocate d
+      for all i: d(i) = c(i) + b(i)
+      deallocate c
+      allocate e
+      for all i: e(i) = -d(i)
+      deallocate d
+      e is the result
+    
+    This will result in memory saving and less allocations, as well as a modest
+    performance improvement on most platforms.
+    Currently, only temporaries on the left-hand side of the operator can be reused,
+    as well as temporaries subject to unary operators - and !.
+
 Summary of important user-visible changes for version 3.2:
 ---------------------------------------------------------