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 22649C4C1 for ; Mon, 6 Aug 2012 03:58:39 +0000 (UTC) Received: (qmail 52784 invoked by uid 500); 6 Aug 2012 03:58:38 -0000 Delivered-To: apmail-commons-dev-archive@commons.apache.org Received: (qmail 52450 invoked by uid 500); 6 Aug 2012 03:58:35 -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 52430 invoked by uid 99); 6 Aug 2012 03:58:34 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 06 Aug 2012 03:58:34 +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 (nike.apache.org: domain of phil.steitz@gmail.com designates 209.85.160.171 as permitted sender) Received: from [209.85.160.171] (HELO mail-gh0-f171.google.com) (209.85.160.171) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 06 Aug 2012 03:58:28 +0000 Received: by ghy16 with SMTP id 16so2743189ghy.30 for ; Sun, 05 Aug 2012 20:58:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=message-id:date:from:user-agent:mime-version:to:subject:references :in-reply-to:content-type:content-transfer-encoding; bh=y1L6tbi+Q7ovgKztTEIlha3N+lHi4Zr+M5gXUJdjP9U=; b=mZXcYlgP69jhdBiwbzUVH/OQd2SEmb4J0Lp9CQokBfChMTCEufVYZSbx1MSI5RK2r9 ZfVexwXeiAcDklOrKvSkM5rujKjXMm2sRdrmWMlF6g/SwhbNTPziY49fuj1BlD7VSpPh KYLnYaGQifrBLIXuKCKsBaozlP+aQFHIlwmt0LMd0fgscx80lSSZjyUQutAgkBT0cc4P roKaJmog+sdiVfqiMAtXyYwHN8NUZB1KaSQYPK1JZESB7pN/uQNxZMIW67Js92zLgpyW gfnPlnUXJdLkhJNAfH48RqwHX45Q1qsISU/N6s4P3VoVeGFDx2c1JP+ho0XYIe8VOo9H GeyQ== Received: by 10.66.75.73 with SMTP id a9mr15214950paw.43.1344225486866; Sun, 05 Aug 2012 20:58:06 -0700 (PDT) Received: from [192.168.2.105] (ip72-208-109-243.ph.ph.cox.net. [72.208.109.243]) by mx.google.com with ESMTPS id rd7sm4615624pbc.70.2012.08.05.20.58.05 (version=SSLv3 cipher=OTHER); Sun, 05 Aug 2012 20:58:06 -0700 (PDT) Message-ID: <501F40CC.70600@gmail.com> Date: Sun, 05 Aug 2012 20:58:04 -0700 From: Phil Steitz User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.7; rv:14.0) Gecko/20120713 Thunderbird/14.0 MIME-Version: 1.0 To: Commons Developers List Subject: Re: [math] MATH-841 gcd speed up References: <380-2201281614413845@M2W113.mail2web.com> In-Reply-To: <380-2201281614413845@M2W113.mail2web.com> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit On 8/5/12 6:44 PM, matic@nimp.co.uk wrote: > Hello, > > The gcd(int,int) method of ArithmeticUtils seems 2 times slower than the > naive approach using modulo operator. > Gilles tested the patch separately and found similar performance penalty. > Please check it out: > https://issues.apache.org/jira/browse/MATH-841?page=com.atlassian.jira.plugi > n.system.issuetabpanels:comment-tabpanel&focusedCommentId=13428944#comment-1 > 3428944 > > Anyone aware of an environment were the modulo operator is painfully slow ? > > Gilles pointed out that my patch don't conform to CM formating style, I > will correct that as well as the javadoc (its mention of the binary gcd > algorithm) if the code change is basically approved here. Please let me > know. It is probably worth doing some research in the archives on this function. I suspect there are reasons for the implementation choices made in the current impl. Could be bad reasons / bad impl, but IIRC there was a fair amount of discussion on this. Phil > > Sebastien > > -------------------------------------------------------------------- > mail2web.com - Microsoft� Exchange solutions from a leading provider - > http://link.mail2web.com/Business/Exchange > > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org > For additional commands, e-mail: dev-help@commons.apache.org > > --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org For additional commands, e-mail: dev-help@commons.apache.org