Hello , does compose desktop support native image(...
# compose-desktop
a
Hello , does compose desktop support native image(graalvm)?
👍 1
e
compose desktop uses swing for windowing, and swing doesn't work well with native-image on all platforms
https://www.graalvm.org/release-notes/21_0/#native-image swing should work on linux but I have not seen it on other platforms
a
Oh, that's a pity, as native image should reduce startup time and memory footprints🥲
a
Is the startup time for a desktop application you have now critical? Like, what is it now and what is your target?
And, how does native binary influence memory footprint you think?
a
For example, Jetbrain Toolbox takes about 2 seconds to display the UI on my machine, I hope compose desktop apps can complete this process in one second
a
And what is this hope based on? What is the reason it takes two seconds?
m
There have been experiments in using native-image + Compose. See here: https://github.com/esp-er/compose-graal-hello
it works by replacing Swing with the JWM library, which takes care of windowing setup and IO
a
@mikehearn Thanks, it is a good try to native world, also waiting for graalvm AWT support to stable. Moreover, perhaps there is other ways to speed up startup time without having to be native
m
There's is appcds
And on macos make sure you aren't triggering GPU switching
Getting back to this: AppCDS is a ~30% win for most apps but is a PITA to deploy. We don't use it in our app for that reason even though we'd like to. Making sure you don't trigger a GPU switch is as easy as adding an Info.plist key, I don't recall what it is but when we added this to the default Conveyor templates this sped up the startup time of the JavaFX sample by a fair bit.
a
Oh, thank you, I'd like have a try.