Skip to content

8361076: Add benchmark for ImageReader in preparation for Valhalla changes #26044

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

david-beaumont
Copy link
Contributor

@david-beaumont david-beaumont commented Jun 30, 2025

Initial benchmark to capture at least some comparative measures of ImageReader performance.

Current results on my laptop:

Benchmark Mode Cnt Score Error Units
NewImageBenchmark.warmCache_CountAllNodes avgt 5 0.785 ± 0.140 ms/op
NewImageBenchmark.coldStart_CountOnly ss 5 34.051 ± 17.662 ms/op
NewImageBenchmark.coldStart_InitAndCount ss 5 31.006 ± 9.674 ms/op
NewImageBenchmark.coldStart_LoadJavacInitClasses ss 5 3.752 ± 6.873 ms/op

The upcoming changes to ImageReader should show significant improvements to these results.


Progress

  • Change must not contain extraneous whitespace
  • Commit message must refer to an issue
  • Change must be properly reviewed (2 reviews required, with at least 1 Reviewer, 1 Author)

Issue

  • JDK-8361076: Add benchmark for ImageReader in preparation for Valhalla changes (Bug - P4)

Reviewers

Reviewing

Using git

Checkout this PR locally:
$ git fetch https://git.openjdk.org/jdk.git pull/26044/head:pull/26044
$ git checkout pull/26044

Update a local copy of the PR:
$ git checkout pull/26044
$ git pull https://git.openjdk.org/jdk.git pull/26044/head

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 26044

View PR using the GUI difftool:
$ git pr show -t 26044

Using diff file

Download this PR as a diff file:
https://git.openjdk.org/jdk/pull/26044.diff

Using Webrev

Link to Webrev Comment

@bridgekeeper
Copy link

bridgekeeper bot commented Jun 30, 2025

👋 Welcome back david-beaumont! A progress list of the required criteria for merging this PR into master will be added to the body of your pull request. There are additional pull request commands available for use with this pull request.

@openjdk
Copy link

openjdk bot commented Jun 30, 2025

@david-beaumont This change is no longer ready for integration - check the PR body for details.

@david-beaumont
Copy link
Contributor Author

I removed a JrtFS related benchmark because it tracked the other one closely enough to not be worth it (hence only 1 additional module export needed).

@openjdk openjdk bot added the rfr Pull request is ready for review label Jun 30, 2025
@openjdk
Copy link

openjdk bot commented Jun 30, 2025

@david-beaumont The following labels will be automatically applied to this pull request:

  • build
  • core-libs

When this pull request is ready to be reviewed, an "RFR" email will be sent to the corresponding mailing lists. If you would like to change these labels, use the /label pull request command.

@openjdk openjdk bot added build build-dev@openjdk.org core-libs core-libs-dev@openjdk.org labels Jun 30, 2025
@mlbridge
Copy link

mlbridge bot commented Jun 30, 2025

Webrevs

}
}

/// NOT a @State since that causes setUp()/tearDown() to be shared, but we
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This comment might have been before I applied Scope.Benchmark to the states below. I'll double check if it's still an issue.

@david-beaumont
Copy link
Contributor Author

Apologies. I realized the name for this class was still completely daft. After spending so much time looking at the details, I didn't spot the obvious.

Copy link
Member

@magicus magicus left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Build change trivially fine.

/reviewers 2

@openjdk openjdk bot added the ready Pull request is ready to be integrated label Jul 1, 2025
@openjdk
Copy link

openjdk bot commented Jul 1, 2025

@magicus
The total number of required reviews for this PR (including the jcheck configuration and the last /reviewers command) is now set to 2 (with at least 1 Reviewer, 1 Author).

@openjdk openjdk bot removed the ready Pull request is ready to be integrated label Jul 1, 2025

// Created by running "java -verbose:class", throwing away anonymous inner
// classes and anything without a reliable name, and grouping by the stated
// source. It's not perfect, but it's representative.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think this is maintainable. How useful (or not) is this benchmark if the names of all the internal classes (that will change from release to release) are dropped from this?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Debatable. It's obviously going to scale any results somewhat based on the size of the resources and number of classes. It's kind nice to see "this change removes at least N micro/milli seconds of time spent" since that's a minimum set of classes we expect to always be needed, so any time saved is a lower bound.

I'd say maybe leave it as is for now with a note saying "if this keeps breaking, make the list less fragile".
I'm also assuming this is only run manually, and not a part of any CI pipeline ... so please let me know if I'm wrong about that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
build build-dev@openjdk.org core-libs core-libs-dev@openjdk.org rfr Pull request is ready for review
Development

Successfully merging this pull request may close these issues.

3 participants