RFR: 8333265: De-duplicate method references in java.util.stream.FindOps

Chen Liang liach at openjdk.org
Thu May 30 13:53:03 UTC 2024


On Thu, 30 May 2024 12:50:36 GMT, Claes Redestad <redestad at openjdk.org> wrote:

> Extracting duplicate method references to static field reduce proxy class spinning and loading. In this case 2 less classes loaded when using `findAny()` on each type of stream.

Marked as reviewed by liach (Author).

Indeed, CallSites are created per indy instruction instead of per CP indy entry (required by JVMS); thus sharing instruction either in initializers or static methods would have the same effect. javac only deduplicates the CP entry.

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

PR Review: https://git.openjdk.org/jdk/pull/19477#pullrequestreview-2088345919
PR Comment: https://git.openjdk.org/jdk/pull/19477#issuecomment-2139602569


More information about the core-libs-dev mailing list