<PR for AppCDS/AOT in Compose Multiplatform for De...
# compose-desktop
a
PR for AppCDS/AOT in Compose Multiplatform for Desktop including speedup times on a test project. TL;DR: On macOS AOT speeds up startup by 2-5x On Windows AOT speeds up startup by 1.5x
K 15
鉂囷笍 4
w
that's great! you always bring so many good news!
馃檹 2
u
openjdk.org/jeps/8335368 For now, Leyden isn't real AoT, but it's coming!
馃憤 1
a
u
It seems to me that the JDK 25 AOT cache (not AppCDS) tolerates the relocation of JARs as long as the relative structure of the classpath remains identical.
a
It doesn't; I checked
I mean it does tolerate it, but so does 21 with AppCDS. But it still tries to read the files at the classpath, and when it doesn't find them, it takes forever
u
I understand, the problem only exists on Windows, your PR only activates it on Mac and Linux ?
a
No, the PR is for all platforms
u
I don't understand anymore, but according to this, it still improves performance on Windows ? it doesn't degrade it then?
a
It depends on the number of AOT-d classes. For a HelloWorld Compose app it's still beneficial.
馃挴 1
u
So on Windows you recommend doing the training on the client side?
a
If you can tolerate the first run being slow, I think so. Until it's fixed, anyway. Although actually I鈥檓 not sure how this bug presents with the auto-cds option.
u
Personally, I activated it 7 or 8 months ago on Windows users who had been using it for a while on a small application I have, and I received very positive feedback despite everything; the cache was created in the CI.
But I noticed increased RAM usage at the beginning, probably because the cache needs to be loaded in addition to the JVM.
a
Did you measure startup time?
u
I'm going to measure; I still have the old builds. These days I only use the native GraalVM compilation; I don't need reflection or class loader.
I've measured it now; initially, I activated it without class linking, and I got a gain of 1.5x. Then I released another build with class linking, and the gain was 2x compared to the first release.
That's in hot start mode.
For the cold start, I missed the measurement for the first release without anything, but the version without class linking takes about 8 seconds and with class linking, 6 seconds.
a
Compare a run on the machine it鈥檚 built on (right from the
build/
directory) to a run on another machine. Or just move the app to a different directory and delete
build/
u
I installed old installers that were built from a ci
a
Ah
You can still compare it with some effort. Check the classpath and make sure the files listed there exist on your machine.
馃憤 1
u
I measured a penalty of 60ms
Now I'm almost certain that out of those 6 seconds, 5 seconds are due to a bug with AWT. I have the same problem with IntelliJ; on the same machine, on Linux, I barely have time to see the splash screen, and on Windows, it takes between 10 and 15 seconds to start.