commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Gilles Sadowski <gil...@harfang.homelinux.org>
Subject Re: svn commit: r1166099 - /commons/proper/math/trunk/src/main/java/org/apache/commons/math/linear/LUDecompositionImpl.java
Date Wed, 07 Sep 2011 11:49:38 GMT
On Wed, Sep 07, 2011 at 11:39:37AM +0100, Mark Thomas wrote:
> On 07/09/2011 11:34, erans@apache.org wrote:
> > Author: erans
> > Date: Wed Sep  7 10:34:49 2011
> > New Revision: 1166099
> > 
> > URL: http://svn.apache.org/viewvc?rev=1166099&view=rev
> > Log:
> > Added "final".
> > Moved declaration of "sum" where it is used.
> 
> You might want to re-consider that. I suspect sum was declared outside
> of the inner loops to save allocating memory for a new double on every
> iteration of the loop. It may be worth moving the declaration outside
> the outer loop too.

Reducing scope makes for clearer code and can lead to _more_ optimized code.


Gilles

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
For additional commands, e-mail: dev-help@commons.apache.org


Mime
View raw message