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

fabioromano1 duke at openjdk.org
Tue Apr 29 11:03:48 UTC 2025


On Mon, 28 Apr 2025 17:06:55 GMT, Raffaello Giulietti <rgiulietti at openjdk.org> wrote:

> Can you show the benchmark results before/after, perhaps specifying the characteristics of your machine (CPU make/model, RAM, OS)?

CPU: Intel Core i3 7100U @ 2.40GHz
RAM: 8,00GB Dual-Channel DDR4 @ 1063MHz
OS: Kali Linux 2025.1a-amd64 (virtual machine on Windows)

With the default JVM on Kali Linux, I get this results:


JMH version: 1.37
VM version: JDK 21.0.7-ea, OpenJDK 64-Bit Server VM, 21.0.7-ea+8-Debian-1

Benchmark                                   Mode  Cnt            Score             Error   Units
BigIntegerPow.testPowL                      avgt    3  18947869090.667 ±  3911381786.675   ns/op
BigIntegerPow.testPowL:gc.alloc.rate        avgt    3         1969.373 ±         409.941  MB/sec
BigIntegerPow.testPowL:gc.alloc.rate.norm   avgt    3  39130645992.000 ±         583.799    B/op
BigIntegerPow.testPowL:gc.count             avgt    3          751.000                    counts
BigIntegerPow.testPowL:gc.time              avgt    3         1459.000                        ms
BigIntegerPow.testPowM                      avgt    3  19118357966.000 ±  3469381107.647   ns/op
BigIntegerPow.testPowM:gc.alloc.rate        avgt    3         1949.412 ±         353.047  MB/sec
BigIntegerPow.testPowM:gc.alloc.rate.norm   avgt    3  39080806429.333 ±         337.057    B/op
BigIntegerPow.testPowM:gc.count             avgt    3          721.000                    counts
BigIntegerPow.testPowM:gc.time              avgt    3         1384.000                        ms
BigIntegerPow.testPowS                      avgt    3  19440511008.000 ± 28974697236.522   ns/op
BigIntegerPow.testPowS:gc.alloc.rate        avgt    3         1836.681 ±        2636.321  MB/sec
BigIntegerPow.testPowS:gc.alloc.rate.norm   avgt    3  37281212394.667 ±         337.057    B/op
BigIntegerPow.testPowS:gc.count             avgt    3          744.000                    counts
BigIntegerPow.testPowS:gc.time              avgt    3         1491.000                        ms
BigIntegerPow.testPowXL                     avgt    3  18702202580.667 ±  3764367371.343   ns/op
BigIntegerPow.testPowXL:gc.alloc.rate       avgt    3         2001.545 ±         402.444  MB/sec
BigIntegerPow.testPowXL:gc.alloc.rate.norm  avgt    3  39249581138.667 ±         337.057    B/op
BigIntegerPow.testPowXL:gc.count            avgt    3          763.000                    counts
BigIntegerPow.testPowXL:gc.time             avgt    3         1398.000                        ms
BigIntegerPow.testPowXS                     avgt    3  15613228655.667 ±  2307582100.089   ns/op
BigIntegerPow.testPowXS:gc.alloc.rate       avgt    3         1807.160 ±         266.932  MB/sec
BigIntegerPow.testPowXS:gc.alloc.rate.norm  avgt    3  29586699256.000 ±         583.799    B/op
BigIntegerPow.testPowXS:gc.count            avgt    3          525.000                    counts
BigIntegerPow.testPowXS:gc.time             avgt    3         1006.000                        ms


Instead, when I try to run the tests with OpenJDK 25, unfortunately I get this Exception:


Exception in thread "main" java.lang.RuntimeException: ERROR: Unable to find the resource: /META-INF/BenchmarkList
        at org.openjdk.jmh.runner.AbstractResourceReader.getReaders(AbstractResourceReader.java:98)
        at org.openjdk.jmh.runner.BenchmarkList.find(BenchmarkList.java:124)
        at org.openjdk.jmh.runner.Runner.internalRun(Runner.java:252)
        at org.openjdk.jmh.runner.Runner.run(Runner.java:208)
        at org.openjdk.jmh.Main.main(Main.java:71)

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

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


More information about the core-libs-dev mailing list