Platform Views are massively expensive and the docs and instrumentation don't highlight this enough. #40108
Labels
a: platform-views
Embedding Android/iOS views in Flutter apps
a: plugins
Support for writing, building, and running plugin packages
d: api docs
Issues with https://api.flutter.dev/
engine
flutter/engine repository. See also e: labels.
framework
flutter/packages/flutter repository. See also f: labels.
P3
Issues that are less important to the Flutter project
team-engine
Owned by Engine team
triaged-engine
Triaged by Engine team
Platform views are massively expensive in terms on memory usage, loss of concurrency, battery usage, additional render target switches, etc.. Based on feedback seen from customers (for example, in this internal doc), it is observed that customers may not be adequately aware of the negative performance implications of the addition of a platform views in their applications. While these impacts were known upfront, they are only documented at the lowest levels of the API at
SceneBuilder::addPlatformView
. Even the documentation at that level is easy to miss. Also, customers rarely use that API directly (instead platform views are wrapped in higher level widgets) and may miss the moment they step off a steep performance cliff.While the implementation of platform views continues to get better, the savings are minor compared to the baseline impact of the addition of a single platform view to the hierarchy. The well informed developer has the opportunity to make their applications significantly more performant and delightful for their users.
A deeper discussion of the performance impact of the feature should include a discussion of the following issues:
It is recommended that these discussions are surfaces at multiple levels in the documentation. Including the following landing pages specifically identified:
I suspect these discussions will need to be quickly and constantly updated as the some of the performance impacts are ameliorated. Platform views are really powerful and sometimes the only way to achieve some key piece of functionality in the application. But a more informed approach to their use can significantly improve application performance along multiple dimensions.
The text was updated successfully, but these errors were encountered: