Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Provide a warm-up API like flutter engine? #3141

Open
wtfisthatzzz opened this issue May 9, 2023 · 5 comments
Open

Provide a warm-up API like flutter engine? #3141

wtfisthatzzz opened this issue May 9, 2023 · 5 comments
Labels
enhancement New feature or request ios performance

Comments

@wtfisthatzzz
Copy link

I added a Compose screen to my ios app. When I enter the Compose screen for the first time, there will be some noticeable lag. Perhaps providing a warm-up API similar to flutter engine can solve this problem?

@MatkovIvan
Copy link
Member

Hi there,

We're already discussing this topic internally, but anyway thanks for bumping this here.
Also, I have to note that we're doing performance related investigations now and it was not a single option to improve the situation on our table. We'll keep you updated.

Related links regarding shader cache in flutter/skia:

@MatkovIvan MatkovIvan removed their assignment May 9, 2023
@tafelnl
Copy link

tafelnl commented Jun 12, 2023

What about Impeller? https://docs.flutter.dev/perf/impeller Or isn't it abstracted in a way that it's usable outside of Flutter?

@tafelnl
Copy link

tafelnl commented Jun 12, 2023

Also as far as I am aware, for Android a different approach is being used. The UI is not drawn on a canvas but with Kotlin Compose instead, so it will be Views and not drawings on a canvas (my understanding at least, because I couldn't really find much documentation about this, and I'm a newbie here). On iOS skia is used to draw stuff on a canvas.

Why not go for a more consistent approach and render elements using UIKit? That's what Reactive Native does. And - more similarly - that's what Redwood does. It seems like a more sensical approach to me.

@elijah-semyonov
Copy link
Contributor

Compose is not responsible for rendering, Compose UI is. Composition is in fact a tree, built on top of nodes emitted by composable functions. In case of Compose UI it's a tree of LayoutNode containing layout, input events logic and aware of how to render itself into implementation of Canvas interface. We use Skia, but you can roll your own solution.

Building rendering on top of UIKit from Compose UI is non-trivial, because Canvas interface (which is tightly coupled with Compose UI expectations) sets up requirements, which are next to impossible to fulfil using UIKit capabilities (such as using arbitrary shader for specific geometry area during the rendering loop).

Redwood uses a tree of own Widget nodes, which resolve into native UI. (Similar to how SwiftUI resolves to watchOS, iOS and macOS SDK specific UI hierarchies).

Platform abstracted node type
Android node type
iOS node type

@okushnikov
Copy link

Please check the following ticket on YouTrack for follow-ups to this issue. GitHub issues will be closed in the coming weeks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request ios performance
Projects
None yet
Development

No branches or pull requests

5 participants