RFR: 8336274: MutableBigInteger.leftShift(int) optimization [v5]
Raffaello Giulietti
rgiulietti at openjdk.org
Mon Sep 2 16:36:22 UTC 2024
On Mon, 2 Sep 2024 16:19:01 GMT, fabioromano1 <duke at openjdk.org> wrote:
>> This implementation of MutableBigInteger.leftShift(int) optimizes the current version, avoiding unnecessary copy of the MutableBigInteger's value content and performing the primitive shifting only in the original portion of the value array rather than in the value yet extended with trailing zeros.
>
> fabioromano1 has updated the pull request with a new target base due to a merge or a rebase. The incremental webrev excludes the unrelated changes brought in by the merge/rebase. The pull request contains six additional commits since the last revision:
>
> - Merge branch 'openjdk:master' into patchLeftShift
> - Code more clear
> - Tests changes
> - Merge branch 'openjdk:master' into patchLeftShift
> - Removed trailing whitespace
> - MutableBigInteger.leftShift(int) optimization
Right, I didn't remember that `BigInteger` has its own implementation.
However, reducing `MutableBigIntegerBox` to just a bunch of accessors to use in the unit test and the benchmarks should still be possible. Then having two copies of that class should be less of an issue.
-------------
PR Comment: https://git.openjdk.org/jdk/pull/20008#issuecomment-2325080149
More information about the core-libs-dev
mailing list