https://kotlinlang.org logo
#compose-desktop
Title
# compose-desktop
a

Alexander Maryanovsky

09/25/2023, 10:38 AM
Found a nice trick. The JVM has a problem where the first time you use some code, it takes a while because of all the classloading, and the first run is always interpreted, until the JIT catches up. So during app startup (say while showing a splashscreen), or at some other convenient time, I render (2-3 times) my main screens via
ImageComposeScene
. That way when the user gets to opening them, they’re already loaded and compiled, and therefore fast.
think smart 5
But you need to do it carefully - you can’t have your main UI and the content of
ImageComposeScene
be composed concurrently.
You can vote for this to have that limitation removed.
m

Michael Paus

09/25/2023, 11:34 AM
In the long run being able to use GraalVM/native-image is probably the better solution. Just my 2 €ent 😉.
j

jw

09/25/2023, 1:22 PM
Longer term this is all about what Project Leydon in the JDK is about, and using AppCDS today would be a good start to minimize the classloading penalty
👍🏻 1
m

Michael Paus

09/25/2023, 1:25 PM
Or maybe CRaC by Azul.
s

spierce7

09/25/2023, 8:53 PM
I didn't know about Project Leydon! This has become increasingly important in serverless environments and for compose Desktop. Graal native images are a fun idea, but are also a huge cost in complexity / messing around with them. Not to mention, their build times.
h

hfhbd

09/26/2023, 5:39 AM
Does anyone know AppCDS is only enabled by default on J9? We do have a great experience on zOS with this feature.
m

Michael Paus

09/26/2023, 7:41 AM
Just to make searching easier. It’s “Leyden”, not “Leydon”. See: https://openjdk.org/projects/leyden/
3 Views