Return-Path: X-Original-To: apmail-commons-dev-archive@www.apache.org Delivered-To: apmail-commons-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id D642B8D49 for ; Wed, 7 Sep 2011 12:46:55 +0000 (UTC) Received: (qmail 56167 invoked by uid 500); 7 Sep 2011 12:46:55 -0000 Delivered-To: apmail-commons-dev-archive@commons.apache.org Received: (qmail 55980 invoked by uid 500); 7 Sep 2011 12:46:51 -0000 Mailing-List: contact dev-help@commons.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: "Commons Developers List" Delivered-To: mailing list dev@commons.apache.org Received: (qmail 55947 invoked by uid 99); 7 Sep 2011 12:46:50 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 07 Sep 2011 12:46:50 +0000 X-ASF-Spam-Status: No, hits=-0.7 required=5.0 tests=RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: local policy) Received: from [193.74.71.28] (HELO sif.is.scarlet.be) (193.74.71.28) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 07 Sep 2011 12:46:44 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=scarlet.be; s=scarlet; t=1315399582; bh=rb2e3esFvwMdqR2HxHzUWJFM9ugWc1ZcXSNUo4G/Hyc=; h=Date:From:To:Subject:Message-ID:References:MIME-Version: Content-Type:In-Reply-To; b=CL8CQlCkPbTtv8umBy3j4E1zFTOs29mGBeQUXtIPQGB9csiZtdKYPwijl870tgm3V pmE6diXqvbaRlcAn+e/nIjTXUoHPgJ4QxTxK401s6tLXW3fc2eYDTytkw4x+tDB8aW hSDsUxi2TTSfaUvlj3O8au46n/OKn15McaUCT4PE= Received: from mail.harfang.homelinux.org (ip-62-235-230-191.dsl.scarlet.be [62.235.230.191]) by sif.is.scarlet.be (8.14.5/8.14.5) with ESMTP id p87CkL93026601 for ; Wed, 7 Sep 2011 14:46:22 +0200 X-Scarlet: d=1315399582 c=62.235.230.191 Received: from localhost (mail.harfang.homelinux.org [192.168.20.11]) by mail.harfang.homelinux.org (Postfix) with ESMTP id 0162A61CE9 for ; Wed, 7 Sep 2011 14:46:22 +0200 (CEST) Received: from mail.harfang.homelinux.org ([192.168.20.11]) by localhost (mail.harfang.homelinux.org [192.168.20.11]) (amavisd-new, port 10024) with ESMTP id Ag+TWZ7ec0Tr for ; Wed, 7 Sep 2011 14:46:19 +0200 (CEST) Received: from dusk.harfang.homelinux.org (mail.harfang.homelinux.org [192.168.20.11]) by mail.harfang.homelinux.org (Postfix) with ESMTP id 8592C6175F for ; Wed, 7 Sep 2011 14:46:19 +0200 (CEST) Received: from eran by dusk.harfang.homelinux.org with local (Exim 4.76) (envelope-from ) id 1R1HWF-000427-9y for dev@commons.apache.org; Wed, 07 Sep 2011 14:46:19 +0200 Date: Wed, 7 Sep 2011 14:46:18 +0200 From: Gilles Sadowski To: dev@commons.apache.org Subject: Re: svn commit: r1166099 - /commons/proper/math/trunk/src/main/java/org/apache/commons/math/linear/LUDecompositionImpl.java Message-ID: <20110907124618.GU2590@dusk.harfang.homelinux.org> Mail-Followup-To: dev@commons.apache.org References: <20110907103449.A98B92388A6E@eris.apache.org> <4E6749E9.9010506@apache.org> <20110907114938.GT2590@dusk.harfang.homelinux.org> <4E676083.1090106@apache.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4E676083.1090106@apache.org> X-Operating-System: Tiny Tux X-PGP-Key-Fingerprint: 53B9 972E C2E6 B93C BEAD 7092 09E6 AF46 51D0 5641 User-Agent: Mutt/1.5.21 (2010-09-15) X-DCC-scarlet.be-Metrics: sif 20001; Body=1 Fuz1=1 Fuz2=1 X-Virus-Scanned: clamav-milter 0.97.1-exp at sif X-Virus-Status: Clean On Wed, Sep 07, 2011 at 01:16:03PM +0100, Mark Thomas wrote: > On 07/09/2011 12:49, Gilles Sadowski wrote: > > 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. > > Cleaner code, certainly. > > As far as optimisation goes I'm not so sure with a primitive. On further > research it looks like the performance should be identical. For an > "interesting" discussion on what exactly is going on I found this: > http://www.javalobby.org/java/forums/t16730.html?start=0 So: - Cleaner code: Yes - Faster code: Maybe - Higher memory usage: No Do we agree that the change is fine? Gilles --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org For additional commands, e-mail: dev-help@commons.apache.org