- Notifications
You must be signed in to change notification settings - Fork 6.1k
8370822: Improve performance for MemorySegment::fill #28031
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
base: master
Are you sure you want to change the base?
8370822: Improve performance for MemorySegment::fill #28031
Conversation
| 👋 Welcome back hextriclosan! A progress list of the required criteria for merging this PR into |
| ❗ This change is not yet ready to be integrated. |
| @hextriclosan The following label will be automatically applied to this pull request:
When this pull request is ready to be reviewed, an "RFR" email will be sent to the corresponding mailing list. If you would like to change these labels, use the /label pull request command. |
| /solves JDK-8370822 |
| @hextriclosan This issue is referenced in the PR title - it will now be updated. |
| I ran some benchmarks and was unable to see any significant performance improvements. I ran on Linux (a64/x64), macOS a64, and Windows x64. Can you provide benchmarks that support this is a performance improvement?
|
Hello Per-Ake, I explored the corresponding code using JITWatch. My analysis shows that the patch reduces the number of instructions (in both bytecode and JIT-compiled assembly). However, as your benchmarks demonstrate, this does not lead to measurable overall performance improvement, the differences fall within normal noise. So, the idea for the patch may be clarity and maintainability, as it simplifies and shortens the code. Thanks. |
Interesting observation. I think reducing bytecode is also important. Are you able to share some JIT-compiled assembly before/after? |


The manual byte-replication expression replaced with the multiplicative expansion trick - a more compact and efficient equivalent.
Progress
Issue
Reviewing
Using
gitCheckout this PR locally:
$ git fetch https://git.openjdk.org/jdk.git pull/28031/head:pull/28031$ git checkout pull/28031Update a local copy of the PR:
$ git checkout pull/28031$ git pull https://git.openjdk.org/jdk.git pull/28031/headUsing Skara CLI tools
Checkout this PR locally:
$ git pr checkout 28031View PR using the GUI difftool:
$ git pr show -t 28031Using diff file
Download this PR as a diff file:
https://git.openjdk.org/jdk/pull/28031.diff
Using Webrev
Link to Webrev Comment