On Mon, 25 May 2026 12:43:49 GMT, Per Minborg <[email protected]> wrote:

> This PR proposes to swap the pattern-matching switch in `LazyConstant` with 
> an if rake to reduce startup time.
> 
> The PR also adds a missing `@DontInline` annotation on the slow path.
> 
> Performance runs across several platforms suggest a ~20-30% startup 
> improvement for noop.
> 
> ---------
> - [x] I confirm that I make this contribution in accordance with the [OpenJDK 
> Interim AI Policy](https://openjdk.org/legal/ai).

src/java.base/share/classes/jdk/internal/lang/LazyConstantImpl.java line 96:

> 94:                 final Object cf = computingFunctionOrExceptionType;
> 95:                 // Don't use pattern matching here in order to improve 
> startup time.
> 96:                 if (cf instanceof Supplier<?> computingFunction) {

But here you do use pattern matching for instanceof...

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

PR Review Comment: https://git.openjdk.org/jdk/pull/31275#discussion_r3302312328

Reply via email to