I've written a Java application that I want to package for the main OSes so that I can provide it as a self-contained installable image. To do this, I use jpackage, with help from the best-named plugin I've come across, The Badass Runtime Plugin (https://badass-runtime-plugin.beryx.org)
My problem is that although the packaging works the performance of the packaged application is dreadful when compared to the compiled Java.
When I build my application (I use gradle for this) on MacOS, the build output includes an install directory containing the compiled classes and a launch script, and an installer directory containing a dmg with the app file.
Running the application from the compiled classes via the launch script works great. Running the application from the app (after installing from the dmg) is very much slower - frequently 10x and worse.
The launch script for the compiled classes points at my local JDK instance (openjdk 16), whereas the app file contains the jdk modules needed for the app to run. This is by design of course, but the only difference I can think of between the two.
Thanks for reading this far - I realise this is a fairly niche problem. If anyone has any experience or thoughts that might help I'd love to hear it.
Thanks, Andy
Edit 10th Sept - thanks for all the interest and comments so far. A couple more notes about my app that might be relevant:
It's a heavy user of RocksDB for off-heap, file-backed data storage. Both the compiled Java and the packaged app use the same sst files, so the data is identical. The app and data are running/present on the same machine, a MacBook Pro with SSD drive and plenty of capacity.
It launches Javalin instances to fire up https connections for a browser based UI and accepting data requests.