Hacker News new | ask | show | jobs
by teho 866 days ago
I'm working on an app that is running on the latest version of Flutter with Impeller enabled. The performance seems good as long as you do not embed platform views inside a list. However, when you drop even a single platform view (web view, video player, google ads...), the performance drops to unacceptable levels even on the latest iOS devices. This is related to another issue with the Flutter ecosystem, it has close to zero support from third parties and therefore you end up having a lot of these platform views. Even things like Google Ads have no native Flutter support and therefore adding a single ad on a list ruins the app. Reading Flutter issues about the performance related issues is sad as the same issues have been there since the beginning and there is no end in sight.

However, if your app can do without any platform views, the performance seems pretty good.

2 comments

You might be interested in Compose Multiplatform, it's from JetBrains and is a combination of Jetpack Compose and Kotlin Multiplatform. You can transparently use both platform views and CM views together in a way that I haven't seen in Flutter.

Here is a video about this where the JetBrains employees go over a demo of building a cross platform app in 100% Kotlin, just as would be the case with Flutter [0]. Check out the timestamp 41:37 where they talk about the above interoperability. They have an example of a messenger app where the messages are in CM while the text input box is in Swift, so that this ensures that you are not reimplementing the native text editing controls as Flutter does, so I see that as a clear advantage for specific things like that.

Also see timestamp 51:23 where they talk about graceful decomposition where if you decide to remove CM, you are left with a regular Android app as CM is backwards compatible with Jetpack Compose.

I use Flutter quite a bit but it seems like Compose Multiplatform might be the future, since it has a number of clear advantages due to how the architecture of CM is set up.

[0] https://www.youtube.com/live/IGuVIRZzVTk

That Compose Multiplatform interoperability with the native views and other way around looks really nice, especially because it matches how SwiftUI deals with UIKit/AppKit interop. However, at this point it is hard to say if they will hit very similar performance issues that Flutter deals with as rest of the UI is not native and is drawn with Skia (as done by Flutter before it moved to Impeller for improved performance). It is definitely very valuable feature nonetheless.
Yeah it might be that JetBrains will eventually realize and move to Impeller or write their own renderer like Rive.app has done for their use case.
What kind of performance drop are you seeing?