-
Notifications
You must be signed in to change notification settings - Fork 6.1k
8349378: Build splashscreen lib with SIZE optimization #23493
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
Conversation
|
👋 Welcome back mbaesken! A progress list of the required criteria for merging this PR into |
|
@MBaesken 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 69 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 |
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.
/reviewers 2
I think this looks good, but someone from client should probably also weigh in.
|
For the record, those are the lib sizes on Windows x86_64, VS2019 (LOW and SIZE uses currently the same opt flag, so same sizes) 204K /windows_x86_64/jdk-opt/images/jdk/bin/splashscreen.dll |
|
Hi @erikj79 thanks for the review ! @magicus , @mrserb , @honkar-jdk any comments? |
|
What tests have you run? |
Had this in our internal test queue with jtreg / JCK plus some additional SAP internal tests. No issues seen. Unfortunately my Linux terminal server does not like the awt jtreg tests (with and without my patch) , so I have to find something else. |
SplashScreen clientlib tests are located - test/jdk/java/awt/SplashScreen. Most of them are manual tests invoked by shell script and it is easier to run the whole test folder. I can run the tests on your behalf to check if the tests work fine with the fix. What are we specifically looking for in the tests with this fix? No degradation in test startup and execution time? |
|
I note that AIX seems to be the biggest beneficiary here. It doesn't seem to be a big deal for anything else. I think what we are looking for in testing is no functional regression plus minimal perf impact on startup. |
Please note that AIX has the debuginfo in the same binary (.so file), unlike e.g. Linux. |
If you find the time to run those, would be great. And yes a noticeable degradation would be important to know. |
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 OK to me. But Harshitha is going to do a bit of testing, so wait for her.
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.
@MBaesken
SplashScreen tests work as expected on all platforms. No regressions observed.
On Linux aarch64 only the debuginfo shrinks but the lib stays about the same in size. Maybe -Os does not work as well on this platform.
Other UNIX platforms have a reduction by ~ 10-20 % .
For Windows, LOW and SIZE optimization have currently the same O - flags so no reduction.
With optimization=SIZE, libsplashscreen file sizes are less on linux and macOS as expected. On Windows, I expected it to be almost the same size (if not smaller) but the .dll files on Windows were slightly bigger with opt=SIZE than with opt=LOW for me (Win 11 x86-64).
Details below.
macOS
--------
408K Feb 10 14:59 libsplashscreen.dylib
96B Feb 10 15:00 libsplashscreen.dylib.dSYM
With opt=SIZE
344K Feb 11 10:38 libsplashscreen.dylib
96B Feb 11 10:39 libsplashscreen.dylib.dSYM
Linux
-----
1.7M Feb 10 16:39 libsplashscreen.debuginfo
364K Feb 10 16:39 libsplashscreen.so
With opt=SIZE
1.4M Feb 11 10:58 libsplashscreen.debuginfo
293K Feb 11 10:58 libsplashscreen.so
Windows
----------
201K Feb 7 15:37 splashscreen.dll
177K Feb 7 15:37 splashscreen.dll.map
1.6M Feb 7 15:37 splashscreen.dll.pdb
With opt=SIZE
547K Feb 11 11:31 splashscreen.dll
281K Feb 11 11:31 splashscreen.dll.map
1.7M Feb 11 11:31 splashscreen.dll.pdb
|
Thanks for the testing.
This is very strange. And this is expected for an opt build because it is https://github.com/openjdk/jdk/blob/master/make/autoconf/flags-cflags.m4#L342 Could you maybe check in your build log that it is O1 for both? Do you see any other differences in your Windows/VS build log ? |
|
@honkar-jdk do you have the latest/newest jdk head, especially this change is important Before the SIZE opt flags for MSVC were bad. |
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.
@honkar-jdk do you have the latest/newest jdk head, especially this change is important 8349214: Improve size optimization flags for MSVC builds 40603a5
Before the SIZE opt flags for MSVC were bad.
Looks like I didn't have this changeset in my repo.
With the size opt flag of -O1 , I see similar .dll file sizes as before. LGTM now.
201K Feb 12 11:29 splashscreen.dll
177K Feb 12 11:30 splashscreen.dll.map
1.6M Feb 12 11:30 splashscreen.dll.pdb
|
Thanks for looking into it ! |
|
/integrate |
|
Going to push as commit c2fc947.
Your commit was automatically rebased without conflicts. |
The splashscreen lib is currently built with LOW optimization.
This might be fine because it is not very performance critical (and LOW is not really low when looking at the opt-flags used).
But building it with SIZE optimization makes it 10-20 % smaller on some platforms which helps to reduce image size.
current settings (LOW optimization) :
2.5M /aix_ppc64/jdk-opt/images/jdk/lib/libsplashscreen.so (not split debuginfo file on AIX currently)
468K /macosaarch64/jdk-opt/images/jdk/lib/libsplashscreen.dylib
1.6M /macosaarch64/jdk-opt/images/jdk/lib/libsplashscreen.dylib.dSYM
388K /macosintel64/jdk-opt/images/jdk/lib/libsplashscreen.dylib
1.5M /macosintel64/jdk-opt/images/jdk/lib/libsplashscreen.dylib.dSYM
368K /linux_aarch64/jdk-opt/images/jdk/lib/libsplashscreen.so
1.7M /linux_aarch64/jdk-opt/images/jdk/lib/libsplashscreen.debuginfo
376K /linux_alpine_x86_64/jdk-opt/images/jdk/lib/libsplashscreen.so
1.8M /linux_alpine_x86_64/jdk-opt/images/jdk/lib/libsplashscreen.debuginfo
500K /linux_ppc64le/jdk-opt/images/jdk/lib/libsplashscreen.so
1.7M /linux_ppc64le/jdk-opt/images/jdk/lib/libsplashscreen.debuginfo
364K /linux_x86_64/jdk-opt/images/jdk/lib/libsplashscreen.so
1.7M /linux_x86_64/jdk-opt/images/jdk/lib/libsplashscreen.debuginfo
new settings (SIZE optimization) :
2.1M /aix_ppc64/jdk-dev-opt/images/jdk/lib/libsplashscreen.so (not split debuginfo file on AIX currently)
404K /macosaarch64/jdk-dev-opt/images/jdk/lib/libsplashscreen.dylib
1.5M /macosaarch64/jdk-dev-opt/images/jdk/lib/libsplashscreen.dylib.dSYM
316K /macosintel64/jdk-dev-opt/images/jdk/lib/libsplashscreen.dylib
1.4M /macosintel64/jdk-dev-opt/images/jdk/lib/libsplashscreen.dylib.dSYM
372K /linux_aarch64/jdk-dev-opt/images/jdk/lib/libsplashscreen.so
1.5M /linux_aarch64/jdk-dev-opt/images/jdk/lib/libsplashscreen.debuginfo
304K /linux_alpine_x86_64/jdk-dev-opt/images/jdk/lib/libsplashscreen.so
1.5M /linux_alpine_x86_64/jdk-dev-opt/images/jdk/lib/libsplashscreen.debuginfo
376K /linux_ppc64le/jdk-dev-opt/images/jdk/lib/libsplashscreen.so
1.4M /linux_ppc64le/jdk-dev-opt/images/jdk/lib/libsplashscreen.debuginfo
304K /linux_x86_64/jdk-dev-opt/images/jdk/lib/libsplashscreen.so
1.4M /linux_x86_64/jdk-dev-opt/images/jdk/lib/libsplashscreen.debuginfo
On Linux aarch64 only the debuginfo shrinks but the lib stays about the same in size. Maybe -Os does not work as well on this platform.
Other UNIX platforms have a reduction by ~ 10-20 % .
For Windows, LOW and SIZE optimization have currently the same O - flags so no reduction.
Build times are the same on Windows (because LOW and SIZE are currently 'optimize for size').
On Linux x86_64 it seems that the build times of java.desktop native libs get slightly better but only very little.
time make java.desktop-libs-only JOBS=1
LOW (current)
real 5m38.074s
user 4m16.709s
sys 0m26.335s
real 5m29.081s
user 4m17.838s
sys 0m26.749s
real 5m25.496s
user 4m17.906s
sys 0m25.506s
SIZE for libsplashscreen
real 5m18.468s
user 4m13.024s
sys 0m25.129s
real 5m31.944s
user 4m12.922s
sys 0m26.333s
real 5m12.874s
user 4m12.253s
sys 0m25.206s
real has a bit of variance but user time is 4m16 / 4m17 for LOW and 4m12/4m13 for SIZE for libsplashscreen.
Progress
Issue
Reviewers
Reviewing
Using
gitCheckout this PR locally:
$ git fetch https://git.openjdk.org/jdk.git pull/23493/head:pull/23493$ git checkout pull/23493Update a local copy of the PR:
$ git checkout pull/23493$ git pull https://git.openjdk.org/jdk.git pull/23493/headUsing Skara CLI tools
Checkout this PR locally:
$ git pr checkout 23493View PR using the GUI difftool:
$ git pr show -t 23493Using diff file
Download this PR as a diff file:
https://git.openjdk.org/jdk/pull/23493.diff
Using Webrev
Link to Webrev Comment