RFR: 8334755: Asymptotically faster implementation of square root algorithm [v45]

Raffaello Giulietti rgiulietti at openjdk.org
Wed Jul 31 17:35:40 UTC 2024


On Sat, 27 Jul 2024 15:01:30 GMT, fabioromano1 <duke at openjdk.org> wrote:

>> On my M1 Pro/32 GiB
>> 
>> Current
>> 
>> Benchmark                                       Mode  Cnt        Score      Error  Units
>> BigIntegerSquareRoot.testBigSqrtAndRemainder    avgt   15       45.655 ?    0.273  ns/op
>> BigIntegerSquareRoot.testHugeSqrtAndRemainder   avgt   15  1200587.822 ? 7358.024  ns/op
>> BigIntegerSquareRoot.testLargeSqrtAndRemainder  avgt   15       27.052 ?    0.143  ns/op
>> BigIntegerSquareRoot.testSmallSqrtAndRemainder  avgt   15       33.098 ?    0.207  ns/op
>> 
>> 
>> New
>> 
>> Benchmark                                       Mode  Cnt      Score    Error  Units
>> BigIntegerSquareRoot.testBigSqrtAndRemainder    avgt   15     21.110 ?  0.151  ns/op
>> BigIntegerSquareRoot.testHugeSqrtAndRemainder   avgt   15  21525.493 ? 36.219  ns/op
>> BigIntegerSquareRoot.testLargeSqrtAndRemainder  avgt   15     14.897 ?  0.257  ns/op
>> BigIntegerSquareRoot.testSmallSqrtAndRemainder  avgt   15     15.539 ?  0.146  ns/op
>> 
>> 
>> Nice!
>
> @rgiulietti Should the current implementation of the square root algorithm be deleted or should it be preserved?

@fabioromano1 The code is in good shape.

I'll probably add some other comments once the suggestions above, and other changes you might want to add, have been committed. No need to rush, though.

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

PR Comment: https://git.openjdk.org/jdk/pull/19710#issuecomment-2261020319


More information about the core-libs-dev mailing list