:thread: Slow first render
# compose-ios
f
🧵 Slow first render
👀 1
Hey folks, I’ve recently noticed a bug in the first render from a fresh install with Compose Multiplatform on iOS. As you can see in the video below, in the first install/first run, there is a delay in loading the compose UI. Subsequent runs work just fine. I was able to reproduce it in a clean/new project. However, the effect on our actual project is much worse. We also noticed a significant impact after updating to Compose 1.7.0, but I’m not sure if that’s related or only because now it crashes on frame drop from the first load. All builds were tested in release mode to ensure it was not a debug case. The sample/reproducer can be found here: https://github.com/faogustavo/ComposeMPFlick/tree/main
screen-recording.mp4
k
I guess the reason is the first skia shaders compilation cc @Andrei Salavei
t
Same issue here, startup takes a few seconds, but it seems this is only when running from Xcode. Production build from the App Store is quicker in my case.
👀 1
If your issue is indeed some shader compilation issue, I am wondering whether this could be related to https://youtrack.jetbrains.com/issue/CMP-6812/EXCCRASH-SIGKILL-on-iOS (see stacktrace)
a
I guess the reason is the first skia shaders compilation
cc @Andrei Salavei
Looks like it. The issue created.
🙏 1
f
Hey folks, any updates related to this issue? We are almost finished with the migration from the SDK to compose the multiplatform. If this isn't something you can provide a better way to handle, we will need to find some way of "hiding" this freeze
a
Hi! I didn't investigate the problem yet. It most likely because skia metal shaders take time to compile. You can either provide compiled shaders with the app (they are located in Cached directory), Or create opaque/hidden controller in advance to make Compose/Skia generate this shaders in advance.