RFR: 8350075: Performance difference between SegmentAllocator methods

Per Minborg pminborg at openjdk.org
Tue Feb 18 11:45:16 UTC 2025


On Fri, 14 Feb 2025 09:19:35 GMT, Per Minborg <pminborg at openjdk.org> wrote:

> This PR proposes to add `@ForceInline` to the `default` methods in `SegmentAllocator` that do not already have it.

There is [a microbenchmark from another PR](test/micro/org/openjdk/bench/java/lang/foreign/ArenaPoolFromBench.java) which is hard to isolate as it depends on changes in the JDK. The changes in this (and not the other) PR has the following implications in said benchmark:

Baseline:

Benchmark                                                                   Mode  Cnt     Score      Error   Units
ArenaPoolFromBench.OfVirtual.pooledInt                                 N/A  avgt   30    29.465 ?    0.922   ns/op
ArenaPoolFromBench.OfVirtual.pooledInt:gc.alloc.rate                   N/A  avgt   30  6482.707 ?  176.227  MB/sec
ArenaPoolFromBench.OfVirtual.pooledInt:gc.alloc.rate.norm              N/A  avgt   30   200.001 ?    0.001    B/op
ArenaPoolFromBench.OfVirtual.pooledInt:gc.count                        N/A  avgt   30   182.000             counts
ArenaPoolFromBench.OfVirtual.pooledInt:gc.time                         N/A  avgt   30   110.000                 ms


Patch:

Benchmark                                                      Mode  Cnt   Score    Error   Units
ArenaPoolFromBench.OfVirtual.pooledInt                         avgt   30   8.351 ?  0.297   ns/op
ArenaPoolFromBench.OfVirtual.pooledInt:gc.alloc.rate           avgt   30   0.013 ?  0.001  MB/sec
ArenaPoolFromBench.OfVirtual.pooledInt:gc.alloc.rate.norm      avgt   30  ? 10??             B/op
ArenaPoolFromBench.OfVirtual.pooledInt:gc.count                avgt   30     ? 0           counts

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

PR Comment: https://git.openjdk.org/jdk/pull/23628#issuecomment-2665418353


More information about the core-libs-dev mailing list