Skip to content

JDK 21, lusearch, and Lucene "regression" #264

@shipilev

Description

@shipilev

Wanted to report a "problem" with current lusearch benchmark in 23.11-chopin, which so far looks like the issue in Lucene support for JDK preview features. In short, running with different JDKs shows that lusearch is substantially slower with JDK 21.

Running self-built JDKs on Graviton 3 instance with:

% shipilev-jdk/build/linux-aarch64-server-release/images/jdk/bin/java -jar dacapo-23.11-chopin.jar lusearch -n 20

...yields these results:

JDK 17-dev: 1584 msec
JDK 21-dev: 2446 msec (!!!)
JDK 22+0:   2455 msec (!!!)
JDK 22+1:   1527 msec
JDK 23-dev: 1519 msec

Bisection shows that the "regression" starts in JDK 19 with: 8282191: Implementation of Foreign Function & Memory API (Preview). We cannot run JDK 19 prior that changeset: Lucene fails with NCDFE trying to access MemorySegment. We suspect that Lucene is opting in some FFM preview features, which are slower than what it used before. Mainline JDK is fast again, but only after JDK starts to identify itself as JDK 22: openjdk/jdk@5a706fb

I suspect that Lucene that ships with 23.11-chopin actually wants JDK 22 to perform well, and the intermediate version that opts-in to JDK 19 preview features is actually slower on this test.

@ChrisHegarty, is there something we can do here? Maybe there is a feature flag that switches what Lucene is using? Maybe Dacapo should update the Lucene to some other version?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions