RFR: 8355719: Reduce memory consumption of BigInteger.pow() [v54]

Raffaello Giulietti rgiulietti at openjdk.org
Thu May 8 18:24:58 UTC 2025


On Thu, 8 May 2025 15:48:30 GMT, Raffaello Giulietti <rgiulietti at openjdk.org> wrote:

>> fabioromano1 has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   Suggested changes
>
> Please update the 2nd copyright year in `BigInteger`.
> 
> Otherwise looks good.
> As soon as you feel comfortable with your changes, let me know so that I can approve.
> 
> Thanks for yet another nice contribution!

> @rgiulietti Could be useful [this optimization](https://github.com/openjdk/jdk/pull/24690#issuecomment-2846711109) for `int` bases whose result does not fit in a `long`?

There are endless optimizations and fast paths that one could conceive, but at some point we must decide to stop and turn our attention to other aspects of the platform. I think we have reached the turning point for this great PR.

Besides, the performance gains of yet another fast-path might be negligible in general usage, at the cost of another 50 lines or so of code that would probably only benefit very narrow use cases.

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

PR Comment: https://git.openjdk.org/jdk/pull/24690#issuecomment-2863897562


More information about the core-libs-dev mailing list