Integrated: 8281259: MutableBigInteger subtraction could be simplified

Daniel Jeliński djelinski at openjdk.java.net
Fri Feb 11 16:28:08 UTC 2022


On Fri, 4 Feb 2022 10:13:28 GMT, Daniel Jeliński <djelinski at openjdk.org> wrote:

> The proposed form of borrow bit handling is [already used in BigInteger class](https://github.com/djelinski/jdk/blob/ce26a19be5e907c11164b46f1bcb370b534d5bf6/src/java.base/share/classes/java/math/BigInteger.java#L1558).
> 
> JMH results without the patch:
> 
> Benchmark            (maxNumbits)  Mode  Cnt        Score        Error  Units
> BigIntegers.testGcd           256  avgt   25  3181205,367 ± 155272,427  ns/op
> 
> JMH results with the patch applied:
> 
> Benchmark            (maxNumbits)  Mode  Cnt        Score       Error  Units
> BigIntegers.testGcd           256  avgt   25  2696030,849 ± 14141,940  ns/op

This pull request has now been integrated.

Changeset: e73ee0ca
Author:    Daniel Jeliński <djelinski at openjdk.org>
Committer: Brian Burkhalter <bpb at openjdk.org>
URL:       https://git.openjdk.java.net/jdk/commit/e73ee0ca10b644600ee3747b901e5f69104d03df
Stats:     16 lines in 2 files changed: 11 ins; 0 del; 5 mod

8281259: MutableBigInteger subtraction could be simplified

Reviewed-by: bpb

-------------

PR: https://git.openjdk.java.net/jdk/pull/7342


More information about the core-libs-dev mailing list