It is possible tu use <app cds> with compose deskt...
# compose-desktop
u
It is possible tu use app cds with compose desktop ?
👀 1
u
It would be really great if this was merged, I keep getting the comment that my apps are slow to start
m
Just out of curiosity, what is slow for you? A simple compose app starts up in about a second or so and if real-world apps take longer then the reasons are often self-made. Meaning that too much initialisation is done already at start-up and is not done in the background is not delayed until it is actually needed. AppCDS would not help much in such a scenario.
u
@Michael Paus No, even a hello world takes much longer than a native app, it's because of the jvm, it takes time to start. Personally, on Mac and Linux, the start-up time is very fast, and the difference is almost not noticeable. On the other hand, on Windows, I find it annoying, and my users are 95% Windows users, with machines that are not necessarily very recent.
m
Actually that’s the point. The relative difference is more noticeable with a hello world app than with a large app where you can do a lot to shift the work to a later point in time and do a lot of work in parallel.
u
@Michael Paus I don't understand, you can't do anything until the jvm has started, what I'm doing now is displaying a splash screen
m
The point that I am trying to make is that if the startup time of a hello world app is already too slow for you, then applying app-cds helps a bit. According to my tests you may be able to bring that down from say 1.0 seconds to 0.5 seconds. But if you have a large app which takes much longer than that, then there are better means to bring that down. Of course, still using app-cds doesn’t hurt and can be done in addition. You can try app-cds right now. See: https://github.com/JetBrains/compose-multiplatform/pull/2080#issuecomment-2242441036 In order to make this work you have to run the compose app locally with a properly prepared JDK. I have not yet found a way to do the same with a packaged app.
u
@Michael Paus Thanks and you know how to provide a path relative the JVM working directory for the jsa file?
m
No, that and a few other things are keeping me from using AppCDS with bundled apps. I also do not feel such a high pressure because I haven’t got any complaints about startup speed from any customer so far. But I’d be interested in a solution nevertheless.
I did some measurements today of startup time with and without AppCDS (just in case you are interested). A real-world app starts on my recent MacBook Pro M4 in 0.63 seconds without AppCDS and in 0.37 seconds with AppCDS. The times where measured by starting the app from a bash script and taking the first timestamp right before executing the command line to start the application. The second timestamp is dumped from the application via a LaunchedEffect in the first screen that is shown. The results for Windows machines may be different.
u
haha my clients sometimes have 8th generation Core i3s 😑
50% improvement is sometimes 3-4 seconds