RFR: 8351565: Implement JEP 502: Stable Values (Preview) [v21]

Maurizio Cimadamore mcimadamore at openjdk.org
Tue Apr 1 10:27:28 UTC 2025


On Mon, 31 Mar 2025 16:03:57 GMT, Per Minborg <pminborg at openjdk.org> wrote:

> Here are the results of the new `MethodHandle` benchmarks:
> 
> ```
> Benchmark                               Mode  Cnt  Score   Error  Units
> StableMethodHandleBenchmark.atomic      avgt   10  3.676 ? 0.206  ns/op
> StableMethodHandleBenchmark.dcl         avgt   10  3.766 ? 0.181  ns/op
> StableMethodHandleBenchmark.finalMh     avgt   10  0.693 ? 0.015  ns/op
> StableMethodHandleBenchmark.map         avgt   10  7.648 ? 0.308  ns/op
> StableMethodHandleBenchmark.nonFinalMh  avgt   10  3.381 ? 0.485  ns/op
> StableMethodHandleBenchmark.stableMap   avgt   10  0.713 ? 0.016  ns/op
> StableMethodHandleBenchmark.stableMh    avgt   10  0.700 ? 0.030  ns/op
> ```

Thanks - I think this shows very clearly what this API is all about ;-) E.g. fast access is one part of the equation, but constant-folding of the accessed result is another very important property. When combined, they allow the kind of performance shown in this benchmark.

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

PR Comment: https://git.openjdk.org/jdk/pull/23972#issuecomment-2768892425


More information about the core-libs-dev mailing list