Could anyone take a look at quality-of-life bug JDK-8258918?

Mike Hearn mike at hydraulic.software
Thu Apr 6 11:05:19 UTC 2023


Developing GUI apps on macOS can be a bit annoying due to slow startup
and screen flashes due to GPU switching. Last week I dug in and found
the solution turned out to be the following JDK patch:

diff --git a/make/data/bundle/cmdline-Info.plist
b/make/data/bundle/cmdline-Info.plist
index 7d6af359128..ebaaee7e827 100644
--- a/make/data/bundle/cmdline-Info.plist
+++ b/make/data/bundle/cmdline-Info.plist
@@ -12,6 +12,8 @@
         <string>@@BUILD_VERSION@@</string>
         <key>NSMicrophoneUsageDescription</key>
         <string>The application is requesting access to the
microphone.</string>
+        <key>NSSupportsAutomaticGraphicsSwitching</key>   <!-- avoids
flashing for unpackaged JavaFX apps -->
+        <true/>
         @@EXTRA@@
 </dict>
 </plist>

I found JDK-8258918 about it, but not much has happened since 2021.

This patch really makes a big difference to how enjoyable it is to do
desktop work with Java on macOS, and it's a two line fix (+a few more
for the release notes). Although the issue goes away if you properly
package your app by including this plist key, that doesn't help during
development which is also the time you're most likely restarting your
app the most. My enjoyment level went up a lot since applying this
patch but of course that requires you to do a custom build of the JDK,
which is a bit much for most GUI devs.

The main risk is that it would reduce performance unexpectedly, so
would need a release note. However, the current setting also reduces
performance in the form of lower battery life and slow startup. For me
this one setting makes as much difference as all of AppCDS so it's
definitely worth it! Could someone maybe look at making the change
(this patch is too small to be copyrightable but I signed the Oracle
CLA in the past anyway).

thanks,
-mike



More information about the client-libs-dev mailing list