RFR: 8281259: MutableBigInteger subtraction could be simplified

Brian Burkhalter bpb at openjdk.java.net
Thu Feb 10 17:25:04 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

Presumably existing regression tests pass and no new ones are needed. Probably a `noreg-*` label is in order on the issue.

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

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


More information about the core-libs-dev mailing list