-
Notifications
You must be signed in to change notification settings - Fork 6.2k
8353273: Reduce number of oop map entries in instances #24330
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
8353273: Reduce number of oop map entries in instances #24330
Conversation
|
👋 Welcome back stuefe! A progress list of the required criteria for merging this PR into |
|
@tstuefe This change now passes all automated pre-integration checks. ℹ️ This project also has non-automated pre-integration requirements. Please see the file CONTRIBUTING.md for details. After integration, the commit message for the final commit will be: You can use pull request commands such as /summary, /contributor and /issue to adjust it as needed. At the time when this comment was updated there had been 17 new commits pushed to the
As there are no conflicts, your changes will automatically be rebased on top of these commits when integrating. If you prefer to avoid this automatic rebasing, please check the documentation for the /integrate command for further details. ➡️ To integrate this PR with the above commit message to the |
311266b to
f52a3c4
Compare
f52a3c4 to
f4933c1
Compare
Webrevs
|
|
Ping @fparain ? |
fparain
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me.
Thank you for improving instances' layouts.
Fred
Thanks Frederic :) |
|
A possible improvement to this code would be to compute if the super class' layout ends with oops during the reconstruction (reconstruct_layout()), to avoid having to iterate over the fields a second time. |
That is a good idea. A prior version of this stored the last field information after constructing the layout in the InstanceKlass (as a "ends_with_oop" bool) but I did not like that, since I did not wanted to add a new member to IK. But if we reconstruct the layout for the super class anyway, I can do the same there. Thansk! |
|
@fparain I adapted your idea. I also added a regression test. |
fparain
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This version looks better.
Thank you for the changes.
Fred
|
Thanks @fparain ! May I have a second review? |
jdksjolen
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi,
Neat change. I have read up on how field layouts work, and this seems correct to me. Let me run this in our CI for a bit and see what comes out before I approve it, thank you.
jdksjolen
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Passes tests, approved.
test/hotspot/jtreg/runtime/FieldLayout/TestOopMapSizeMinimal.java
Outdated
Show resolved
Hide resolved
…ap-entries-in-instance-objects
|
Thank you all. /integrate |
|
Going to push as commit 743d1c6.
Your commit was automatically rebased without conflicts. |
In preparation for planned GC performance improvements (KLUT), I would like to reduce the average number of oop map entries.
For details, please see JBS issue text.
Patch results:
The patch brings a positive change of oop map size, reducing the likelihood of lengthy oop maps. Here the oop map size distribution over all JDK classes in the JDK image:
Before:
Now:
For example,
java.util.concurrent.ConcurrentHashMap$TreeNodeis changed from having 2 entries to having just one entry, which is nice for a class that may be instantiated a lot:Before:
Now:
Note how the sole primitive field of the derived class, "red", changed position to let oops lead.
Here a contrived example to demonstrate how reordering works across several inheritance levels:
Before:
After
Progress
Issue
Reviewers
Reviewing
Using
gitCheckout this PR locally:
$ git fetch https://git.openjdk.org/jdk.git pull/24330/head:pull/24330$ git checkout pull/24330Update a local copy of the PR:
$ git checkout pull/24330$ git pull https://git.openjdk.org/jdk.git pull/24330/headUsing Skara CLI tools
Checkout this PR locally:
$ git pr checkout 24330View PR using the GUI difftool:
$ git pr show -t 24330Using diff file
Download this PR as a diff file:
https://git.openjdk.org/jdk/pull/24330.diff
Using Webrev
Link to Webrev Comment