You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@commons.apache.org by sebb <se...@gmail.com> on 2012/08/06 10:30:44 UTC

Re: [math] MATH-841 gcd speed up

On 6 August 2012 04:58, Phil Steitz <ph...@gmail.com> wrote:
> 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.

And then please add the details to the code itself for future
readers/maintainers.

> 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
>

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