Repository navigation
Bad PlatformView performance on Android #53532
Copy link
Copy link
Open
Labels
P2Important issues not at the top of the work listImportant issues not at the top of the work lista: platform-viewsEmbedding Android/iOS views in Flutter appsEmbedding Android/iOS views in Flutter appsc: performanceRelates to speed or footprint issues (see "perf:" labels)Relates to speed or footprint issues (see "perf:" labels)c: renderingUI glitches reported at the engine/skia or impeller rendering levelUI glitches reported at the engine/skia or impeller rendering levelengineflutter/engine related. See also e: labels.flutter/engine related. See also e: labels.perf: speedPerformance issues related to (mostly rendering) speedPerformance issues related to (mostly rendering) speedplatform-androidAndroid applications specificallyAndroid applications specificallyteam-androidOwned by Android platform teamOwned by Android platform teamtriaged-androidTriaged by Android platform teamTriaged by Android platform team
Description
I'm trying to integrate native OpenGL rendering by exposing GLSurfaceView as PlatformView.
On my Nexus 6P (Android 8.1) the performance is quite bad, rendering is not smooth.
Here is a complete example:
https://github.com/t-artikov/flutter_platform_view_test
flutter doctor -v
[✓] Flutter (Channel master, v1.16.4-pre.18, on Linux, locale en_US.UTF-8)
• Flutter version 1.16.4-pre.18 at /home/timur/flutter
• Framework revision c8efcb632b (2 days ago), 2020-03-27 22:31:01 -0700
• Engine revision 3ee9e3d378
• Dart version 2.8.0 (build 2.8.0-dev.18.0 1402e8e1a4)
[✓] Android toolchain - develop for Android devices (Android SDK version 29.0.2)
• Android SDK at /home/timur/Android/Sdk
• Android NDK location not configured (optional; useful for native profiling support)
• Platform android-29, build-tools 29.0.2
• ANDROID_HOME = /home/timur/Android/Sdk
• Java binary at: /snap/android-studio/84/android-studio/jre/bin/java
• Java version OpenJDK Runtime Environment (build 1.8.0_212-release-1586-b4-5784211)
• All Android licenses accepted.
[✓] Linux toolchain - develop for Linux desktop
• clang++ 9.0.0
• GNU Make 4.1
[✓] Android Studio (version 3.6)
• Android Studio at /snap/android-studio/84/android-studio
• Flutter plugin version 44.0.2
• Dart plugin version 192.7761
• Java version OpenJDK Runtime Environment (build 1.8.0_212-release-1586-b4-5784211)
[✓] VS Code (version 1.43.0)
• VS Code at /usr/share/code
• Flutter extension version 3.8.1
[✓] Connected device (2 available)
• Nexus 6P • ENU7N15B06000345 • android-arm64 • Android 8.1.0 (API 27)
• Linux • Linux • linux-x64 • Linux
• No issues found!
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
P2Important issues not at the top of the work listImportant issues not at the top of the work lista: platform-viewsEmbedding Android/iOS views in Flutter appsEmbedding Android/iOS views in Flutter appsc: performanceRelates to speed or footprint issues (see "perf:" labels)Relates to speed or footprint issues (see "perf:" labels)c: renderingUI glitches reported at the engine/skia or impeller rendering levelUI glitches reported at the engine/skia or impeller rendering levelengineflutter/engine related. See also e: labels.flutter/engine related. See also e: labels.perf: speedPerformance issues related to (mostly rendering) speedPerformance issues related to (mostly rendering) speedplatform-androidAndroid applications specificallyAndroid applications specificallyteam-androidOwned by Android platform teamOwned by Android platform teamtriaged-androidTriaged by Android platform teamTriaged by Android platform team
Activity
t-artikov commentedon Mar 29, 2020
#53533 can be a solution in some cases.
TahaTesser commentedon Mar 30, 2020
Galaxy M30 (Android 10)
t-artikov commentedon Mar 30, 2020
@TahaTesser
Thanks.
It's better to measure performance in profile mode rather than debug.
Also the Flutter performance overlay is not the only criterion. It is possible that the Flutter UI is rendered smoothly, but the PlatformView content is not. Therefore, there is an additional performance indicator - a rectangle in the lower left corner. When performance is good, it should be solid purple.
t-artikov commentedon Mar 30, 2020
@amirh, @mklim
t-artikov commentedon Apr 4, 2020
Observatory timeline added.
a07ba90 Reverts "Re-re-land "Upgrade all[most] androidx dependencies …
a07ba90 Reverts "Re-re-land "Upgrade all[most] androidx dependencies …
a07ba90 Reverts "Re-re-land "Upgrade all[most] androidx dependencies …
a07ba90 Reverts "Re-re-land "Upgrade all[most] androidx dependencies …
Roll Flutter Engine from be7db94 to afa7ce1 (18 revisions) (#150762)