RFR: 8355719: Reduce memory consumption of BigInteger.pow() [v38]
Chen Liang
liach at openjdk.org
Mon Apr 28 14:29:56 UTC 2025
On Mon, 28 Apr 2025 14:18:34 GMT, fabioromano1 <duke at openjdk.org> wrote:
>> Doesn't pre-seeding involve extra cpu cycles which are defintely wasted if the results aren't used?
>
>> Doesn't pre-seeding involve extra cpu cycles which are defintely wasted if the results aren't used?
>
> It would involve just 3 assignments and 3 multiplications of 64-bit words, I think the overhead is negligible.
In this case you can still use computePower and remove the branching to check if double arithmetic should be used - you are passing the cache array, so you can control what is the initial values in that array.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/24690#discussion_r2063782835
More information about the core-libs-dev
mailing list